/* Quiz styles (lightweight, a11y-first) */

/* ===== QUIZ ROOT CONTAINER ===== */
#quiz-root { 
    padding: 1.5rem; 
    max-width: 800px;
    margin: 0 auto;
}

/* ===== FIELDSETS ===== */
#quiz-root fieldset { 
    border: 1px solid var(--border-color, #e5e7eb); 
    border-radius: 12px; 
    padding: 1rem 1.25rem; 
    margin-bottom: 1.5rem;
    background: var(--bg-card, #ffffff);
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0,0,0,0.05));
}

#quiz-root legend { 
    font-weight: 600; 
    padding: 0 .5rem; 
    color: var(--text-primary, #212529);
    font-size: 1.1rem;
}

/* ===== QUIZ QUESTIONS ===== */
.quiz-q { 
    margin: .75rem 0 1rem; 
}

.quiz-q > label { 
    display: block; 
    margin-bottom: .75rem; 
    color: var(--text-secondary, #495057);
    font-weight: 500;
    line-height: 1.4;
}

/* ===== LIKERT SCALE ===== */
.likert { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: .75rem; 
    align-items: center; 
    margin: 1rem 0;
}

.likert input[type="radio"] { 
    position: absolute; 
    opacity: 0; 
    pointer-events: none; 
}

.likert label { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    height: 44px; 
    border-radius: var(--border-radius, 12px); 
    border: 2px solid var(--border-color, #e5e7eb); 
    background: var(--bg-card, #ffffff); 
    cursor: pointer; 
    user-select: none; 
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: center;
    padding: 0 0.5rem;
}

.likert label:hover { 
    transform: translateY(-1px); 
    box-shadow: var(--shadow-md, 0 5px 15px rgba(0,0,0,0.08)); 
    border-color: var(--resource-secondary, #0a9396);
}

.likert input[type="radio"]:checked + label { 
    background: linear-gradient(135deg, var(--resource-secondary, #0a9396), var(--resource-primary, #005f73)); 
    border-color: var(--resource-secondary, #0a9396); 
    box-shadow: var(--shadow-md, 0 5px 15px rgba(0,0,0,0.08));
    color: white;
    transform: translateY(-1px);
}

/* ===== FORM ACTIONS ===== */
.form-actions { 
    display: flex; 
    gap: .75rem; 
    flex-wrap: wrap; 
    margin-top: 2rem;
    justify-content: center;
}

.form-actions .btn { 
    min-height: 44px;
    min-width: 140px;
}

/* Override disabled state for export button */
.form-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-actions .btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ===== SMALL TEXT ===== */
.small {
    font-size: 0.875rem;
}

.muted {
    color: var(--text-secondary, #495057);
    font-style: italic;
}

/* ===== RESULTS SECTION ===== */
.results { 
    margin-top: 2rem; 
    padding-top: 1.5rem; 
    border-top: 2px solid var(--border-color, #e5e7eb);
    background: var(--bg-card, #ffffff);
    border-radius: var(--border-radius, 12px);
    padding: 1.5rem;
    box-shadow: var(--shadow-md, 0 5px 15px rgba(0,0,0,0.08));
}

.results h2 {
    color: var(--resource-primary, #005f73);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

#score-summary { 
    font-weight: 600; 
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary, #212529);
}

.dimension-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 1rem; 
    margin: 1rem 0; 
}

.dim-item { 
    background: var(--bg-card, #ffffff); 
    border: 1px solid var(--border-color, #e5e7eb); 
    border-radius: var(--border-radius, 12px); 
    padding: 1rem; 
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0,0,0,0.05)); 
}

.dim-item h3 {
    margin-bottom: 0.5rem;
    color: var(--resource-primary, #005f73);
    font-size: 1rem;
}

.dim-bar { 
    height: 8px; 
    background: var(--border-color, #e5e7eb); 
    border-radius: 999px; 
    overflow: hidden; 
    margin: .5rem 0; 
}

.dim-bar span { 
    display: block; 
    height: 100%; 
    background: linear-gradient(90deg, var(--resource-secondary, #0a9396), var(--resource-primary, #005f73)); 
    transition: width 0.5s ease;
}

.recommendations {
    margin-top: 1.5rem;
}

.recommendations h3 {
    color: var(--resource-primary, #005f73);
    margin-bottom: 1rem;
}

.recommendations p { 
    background: var(--bg-main, #f8f9fa); 
    border: 1px solid var(--border-color, #e5e7eb); 
    border-radius: var(--border-radius, 12px); 
    padding: 1rem; 
    margin: .75rem 0;
    line-height: 1.5;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    #quiz-root {
        padding: 1rem;
    }
    
    .likert { 
        grid-template-columns: 1fr; 
        gap: 0.5rem;
    }
    
    .likert label {
        height: 40px;
        font-size: 0.85rem;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .form-actions .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .dimension-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    #quiz-root fieldset {
        padding: 0.75rem 1rem;
        margin-bottom: 1rem;
    }
    
    .quiz-q > label {
        font-size: 0.95rem;
    }
    
    .results {
        padding: 1rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .nav-bar, .back-to-site, .form-actions, .footer { 
        display: none !important; 
    }
    
    body { 
        background: #fff; 
    }
    
    .resource-header { 
        -webkit-print-color-adjust: exact; 
        print-color-adjust: exact; 
    }
    
    .results {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .likert label,
    .likert input[type="radio"]:checked + label,
    .dim-bar span {
        transition: none;
    }
}

/* Focus styles for better keyboard navigation */
.likert input[type="radio"]:focus + label {
    outline: 2px solid var(--resource-secondary, #0a9396);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .likert label {
        border-width: 2px;
    }
    
    .likert input[type="radio"]:checked + label {
        border-width: 3px;
    }
}
