/* Compact Assessment Results Modal Styles */

/* Modal Base Styles */
.compact-results-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Modal Overlay */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

/* Modal Container */
.modal-container {
    position: relative;
    background: linear-gradient(135deg, #001955 0%, #0049bf 100%);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    margin: 2% auto;
    max-width: 800px;
    max-height: 90vh;
    width: 90%;
    overflow: hidden;
    animation: modalSlideIn 0.4s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modal Animation */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}

.modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.modal-close:active {
    transform: scale(0.95);
}

/* Modal Content */
.modal-content {
    padding: 32px;
    overflow-y: auto;
    max-height: calc(90vh - 180px);
}

/* User Section */
.user-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info h3 {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.user-info p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 4px 0;
    font-size: 14px;
}

.completion-date {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 12px !important;
    font-style: italic;
}

/* Overall Score Section */
.overall-score-section {
    text-align: center;
    margin-bottom: 32px;
}

.overall-score-section h3 {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 24px 0;
}

.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8) 0%, rgba(37, 99, 235, 0.8) 100%);
    border: 4px solid rgba(96, 165, 250, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
}

.score-number {
    font-size: 42px;
    font-weight: 900;
    color: white;
    line-height: 1;
}

.score-details {
    text-align: center;
    width: 100%;
}

.score-label {
    color: #F59E0B;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.score-range {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.range-min, .range-max {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
}

.range-bar {
    flex: 1;
    max-width: 200px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.range-indicator {
    height: 100%;
    background: linear-gradient(90deg, #F59E0B 0%, #F7931E 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 1s ease-out;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* Dimensions Section */
.dimensions-section {
    margin-bottom: 32px;
}

.dimensions-section h3 {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
}

.dimensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.dimension-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.dimension-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.dimension-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.control-icon {
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%);
}

.ownership-icon {
    background: linear-gradient(135deg, #FB923C 0%, #F97316 100%);
}

.reach-icon {
    background: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
}

.endurance-icon {
    background: linear-gradient(135deg, #34D399 0%, #10B981 100%);
}

.dimension-info {
    flex: 1;
}

.dimension-info h4 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dimension-score {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 8px;
}

.dimension-score span:first-child {
    color: white;
    font-size: 24px;
    font-weight: 700;
}

.score-max {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.dimension-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 1s ease-out;
}

.control-fill {
    background: linear-gradient(90deg, #60A5FA 0%, #3B82F6 100%);
}

.ownership-fill {
    background: linear-gradient(90deg, #FB923C 0%, #F97316 100%);
}

.reach-fill {
    background: linear-gradient(90deg, #22D3EE 0%, #06B6D4 100%);
}

.endurance-fill {
    background: linear-gradient(90deg, #34D399 0%, #10B981 100%);
}

/* Comparison Section */
.comparison-section {
    margin-bottom: 32px;
}

.comparison-section h3 {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
}

.comparison-chart {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.comparison-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.your-score {
    background: linear-gradient(90deg, #F59E0B 0%, #F7931E 100%);
}

.legend-color.global-average {
    background: linear-gradient(90deg, #60A5FA 0%, #3B82F6 100%);
}

.legend-item span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* Interpretation Section */
.interpretation-section {
    margin-bottom: 32px;
}

.interpretation-section h3 {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 16px 0;
}

.interpretation-text {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 24px 32px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    padding: 12px 24px;
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 44px; /* Touch-friendly size */
}

.btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-container {
        margin: 1% auto;
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 20px 24px;
    }

    .modal-content {
        padding: 24px;
        max-height: calc(95vh - 160px);
    }

    .modal-footer {
        padding: 20px 24px;
        justify-content: center;
    }

    .user-section {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .score-circle {
        width: 100px;
        height: 100px;
    }

    .score-number {
        font-size: 36px;
    }

    .dimensions-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .dimension-card {
        padding: 16px;
    }

    .comparison-legend {
        gap: 16px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .modal-container {
        width: 98%;
        margin: 0 auto;
        border-radius: 16px 16px 0 0;
        max-height: 98vh;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-content {
        padding: 20px;
        max-height: calc(98vh - 140px);
    }

    .modal-footer {
        padding: 16px 20px;
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .score-circle {
        width: 80px;
        height: 80px;
    }

    .score-number {
        font-size: 28px;
    }

    .score-label {
        font-size: 16px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .modal-container {
        border: 2px solid white;
    }

    .btn {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .modal-container,
    .range-indicator,
    .bar-fill,
    .btn,
    .dimension-card {
        animation: none;
        transition: none;
    }
}

/* Print Styles */
@media print {
    .compact-results-modal {
        position: static;
        width: 100%;
        height: auto;
        background: white;
    }

    .modal-overlay,
    .modal-close,
    .modal-footer {
        display: none !important;
    }

    .modal-container {
        background: white;
        color: black;
        box-shadow: none;
        border: 1px solid black;
        margin: 0;
        padding: 20px;
        max-height: none;
        width: 100%;
    }

    .modal-header,
    .modal-content {
        background: white;
        color: black;
    }

    .score-circle {
        background: #3B82F6 !important;
        color: white;
    }

    .user-section,
    .dimension-card,
    .interpretation-text {
        background: #f5f5f5;
        border: 1px solid #ddd;
    }

    .modal-title,
    .user-info h3,
    .dimensions-section h3,
    .interpretation-section h3 {
        color: black;
    }

    .user-info p,
    .interpretation-text {
        color: #333;
    }
}