/* Reset e base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--background);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 5px;
}

header .description {
    font-size: 1rem;
    opacity: 0.9;
}

/* Progress Bar */
#progress-container {
    background: var(--card-bg);
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

#progress-bar {
    width: 0%;
    height: 8px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.3s ease;
}

#progress-text {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Section Cards */
.section-card {
    background: var(--card-bg);
    margin: 20px 30px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.section-card h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.section-instruction {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-weight: 500;
}

/* Instructions */
#instructions ul {
    list-style-position: inside;
    margin: 15px 0;
    color: var(--text-secondary);
}

#instructions li {
    margin: 8px 0;
    padding-left: 10px;
}

/* Question Groups */
.question-group {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.question-label {
    display: block;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 15px;
}

/* Radio Groups */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.radio-group label:hover {
    border-color: var(--primary-color);
    background: #f0f9ff;
}

.radio-group label input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.radio-group label input[type="radio"]:checked + span,
.radio-group label:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: #eff6ff;
    font-weight: 600;
}

/* Vertical Radio Group (for question 32) */
.radio-group.vertical label {
    padding: 15px;
    line-height: 1.5;
}

/* Happiness Scale (Question 31) */
.happiness-scale {
    margin-top: 10px;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.scale-group {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 5px;
}

.scale-group label {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 14px 32px;
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.button-container {
    text-align: center;
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Results */
#results {
    padding: 20px 0;
}

.results-summary {
    margin-bottom: 30px;
}

.result-item {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 10px;
    border: 1px solid #bae6fd;
}

.result-item.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.result-item.total h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    opacity: 0.95;
}

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

.score-number {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}

.score-label {
    font-size: 1.2rem;
    opacity: 0.9;
}

.results-details h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.result-header h4 {
    color: var(--primary-dark);
    font-size: 1.2rem;
}

.score-badge {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
}

.result-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.6;
}

.score-bar {
    width: 100%;
    height: 10px;
    background: #e0f2fe;
    border-radius: 10px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.info-box {
    background: #fef3c7;
    border: 2px solid #fbbf24;
    border-radius: 10px;
    padding: 20px;
    margin-top: 30px;
}

.info-box h4 {
    color: #92400e;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.info-box p {
    color: #78350f;
    margin: 8px 0;
    font-size: 0.95rem;
}

/* Footer */
footer {
    background: var(--card-bg);
    padding: 20px 30px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 8px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    .section-card {
        margin: 15px 20px;
        padding: 20px;
    }

    .section-card h2 {
        font-size: 1.5rem;
    }

    .question-group {
        padding: 15px;
    }

    .question-label {
        font-size: 1rem;
    }

    .radio-group label {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .scale-group label {
        padding: 10px 5px;
        font-size: 0.85rem;
    }

    .scale-labels {
        font-size: 0.8rem;
    }

    .score-number {
        font-size: 3rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 1rem;
    }

    .button-container {
        flex-direction: column;
    }

    .button-container .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.6rem;
    }

    header .subtitle {
        font-size: 1rem;
    }

    header .description {
        font-size: 0.9rem;
    }

    .section-card {
        margin: 10px;
        padding: 15px;
    }

    .score-number {
        font-size: 2.5rem;
    }

    .score-label {
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
    }

    header {
        background: none;
        color: black;
    }

    .button-container {
        display: none;
    }

    #progress-container {
        display: none;
    }

    .section-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
