/*
 * CT Xuân Hòa - Main Stylesheet
 * Website: ct.xuanhoa.art
 * Optimized for elderly users with larger fonts and high contrast
 */

/* CSS Variables */
:root {
    --primary-color: #2e7d32;
    --primary-dark: #1b5e20;
    --primary-light: #4caf50;
    --secondary-color: #1565c0;
    --accent-color: #ff6f00;
    --text-color: #333333;
    --text-light: #666666;
    --background-color: #ffffff;
    --background-light: #f5f5f5;
    --background-section: #fafafa;
    --border-color: #e0e0e0;
    --error-color: #d32f2f;
    --success-color: #388e3c;
    --warning-color: #f57c00;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --font-size-base: 18px;
    --line-height: 1.7;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: var(--line-height);
    color: var(--text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

ul, ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Header */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: white;
    text-decoration: none;
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
    color: white;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: rgba(255, 255, 255, 0.2);
    text-decoration: none;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
}

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

.btn-primary:hover {
    background-color: #e65100;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

.btn-secondary:hover {
    background-color: var(--border-color);
    color: var(--text-color);
    text-decoration: none;
}

.btn-large {
    padding: 1.25rem 3rem;
    font-size: 1.2rem;
}

/* Questionnaire Section */
.questionnaire-section {
    padding: 4rem 0;
    background-color: var(--background-section);
}

.questionnaire-section h2 {
    text-align: center;
    margin-bottom: 1rem;
}

.section-desc {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

/* Form Styles */
.questionnaire-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.form-section h3 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.radio-group label,
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

/* Question Items */
.question-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.question-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.question {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.options label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.05rem;
}

.options label:hover {
    background-color: rgba(46, 125, 50, 0.1);
}

.options input[type="radio"],
.options input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.checkbox-options label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Results Section */
.results-section {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-top: 2rem;
    box-shadow: var(--shadow);
}

.results-section h3 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.result-summary {
    text-align: center;
    margin-bottom: 2rem;
}

.score-display {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
}

.max-score {
    font-size: 1.5rem;
    color: var(--text-light);
}

.score-interpretation {
    font-size: 1.3rem;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
}

.score-interpretation.excellent {
    background-color: #e8f5e9;
    color: var(--success-color);
}

.score-interpretation.good {
    background-color: #e3f2fd;
    color: var(--secondary-color);
}

.score-interpretation.moderate {
    background-color: #fff3e0;
    color: var(--warning-color);
}

.score-interpretation.needs-attention {
    background-color: #ffebee;
    color: var(--error-color);
}

/* Category Scores */
.category-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.category-item {
    background-color: var(--background-light);
    padding: 1.25rem;
    border-radius: var(--border-radius);
}

.category-item h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.progress-bar {
    height: 12px;
    background-color: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 6px;
    transition: width 0.5s ease;
}

.category-score {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Recommendations */
.recommendations {
    background-color: #e8f5e9;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.recommendations h4 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.recommendation-list {
    list-style: none;
    padding: 0;
}

.recommendation-list li {
    padding: 0.75rem 0;
    padding-left: 1.5rem;
    position: relative;
    border-bottom: 1px solid rgba(46, 125, 50, 0.2);
}

.recommendation-list li:last-child {
    border-bottom: none;
}

.recommendation-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Disclaimer */
.disclaimer {
    background-color: #fff3e0;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--warning-color);
    margin-bottom: 2rem;
}

.disclaimer p {
    margin: 0;
    color: var(--warning-color);
}

/* About Section */
.about-section {
    padding: 4rem 0;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text ul {
    list-style: none;
    padding: 0;
}

.about-text li {
    padding: 1rem 0;
    padding-left: 2rem;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.about-text li:last-child {
    border-bottom: none;
}

.about-text li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* Contact Section */
.contact-section {
    padding: 4rem 0;
    background-color: var(--background-section);
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.contact-item {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.contact-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Footer */
.footer {
    background-color: #263238;
    color: white;
    padding: 3rem 0 1.5rem;
}

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

.footer-section h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* Policy Pages */
.policy-page {
    padding: 4rem 0;
}

.policy-content {
    max-width: 800px;
    margin: 0 auto;
}

.policy-content h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.last-updated {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
}

.policy-content section {
    margin-bottom: 2.5rem;
}

.policy-content h2 {
    color: var(--primary-dark);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.policy-content h3 {
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

/* Important Notice Box */
.important-notice {
    background-color: #e3f2fd;
    border-left: 4px solid var(--secondary-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
}

.important-notice.warning {
    background-color: #fff3e0;
    border-left-color: var(--warning-color);
}

.important-notice.emergency {
    background-color: #ffebee;
    border-left-color: var(--error-color);
}

.important-notice p {
    margin-bottom: 0.5rem;
}

.important-notice p:last-child {
    margin-bottom: 0;
}

/* Cookie Table */
.cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.cookie-table th,
.cookie-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.cookie-table th {
    background-color: var(--background-light);
    font-weight: 600;
}

.cookie-table tr:nth-child(even) {
    background-color: var(--background-section);
}

/* Contact List in Policy */
.contact-list {
    list-style: none;
    padding: 0;
    background-color: var(--background-light);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
}

.contact-list li {
    padding: 0.5rem 0;
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .btn,
    .mobile-menu-btn {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .results-section {
        box-shadow: none;
        border: 1px solid #000;
    }

    .progress-bar {
        border: 1px solid #000;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }

    /* Fix mobile button touch issues */
    button, .btn, input[type="submit"], input[type="button"] {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
        position: relative;
        z-index: 1;
    }

    #start-survey-btn {
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
        pointer-events: auto !important;
        z-index: 100 !important;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--primary-dark);
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        display: block;
        padding: 0.75rem 1rem;
    }

    .hero h2 {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .form-section {
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .checkbox-options {
        grid-template-columns: 1fr;
    }

    .category-scores {
        grid-template-columns: 1fr;
    }

    .contact-info {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .cookie-table {
        font-size: 0.9rem;
    }

    .cookie-table th,
    .cookie-table td {
        padding: 0.5rem;
    }
}

/* High Contrast Mode for Accessibility */
@media (prefers-contrast: high) {
    :root {
        --text-color: #000000;
        --background-color: #ffffff;
        --border-color: #000000;
    }

    .btn-primary {
        border: 2px solid #000000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Focus Styles for Accessibility */
*:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 1001;
}

.skip-link:focus {
    top: 0;
}
