:root {
    --primary-color: #ff8a8a; /* Soft Coral */
    --font-heading: 'Lora', serif;
    --font-body: 'Inter', sans-serif;
    --text-color-light: rgba(255, 255, 255, 0.9);
    --text-color-dark: #333;
    --container-width: 1000px;
}

/* --- Animated Background & Global Styles --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font-body);
    color: var(--text-color-light);
    line-height: 1.8;
    background: linear-gradient(-45deg, #4158D0, #C850C0, #FFCC70);
    background-size: 400% 400%;
    animation: gradientAnimation 20s ease infinite;
}
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.page-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
main { flex-grow: 1; }
.container { width: 100%; max-width: var(--container-width); margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; }
h2 { font-size: 2.8rem; text-align: center; }

/* --- Header & Footer --- */
.site-header, .site-footer {
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}
.site-header { padding: 20px 0; }
.header-container { display: flex; justify-content: space-between; align-items: center; }
.logo a { color: #fff; text-decoration: none; font-size: 1.5rem; font-weight: 700; font-family: var(--font-heading); }
.main-nav ul { list-style: none; display: flex; gap: 30px; }
.main-nav a { color: var(--text-color-light); text-decoration: none; font-weight: 500; transition: color 0.3s ease; }
.main-nav a:hover { color: #fff; text-decoration: underline; }
.site-footer { padding: 25px 20px; text-align: center; font-size: 0.9rem; border-top: 1px solid rgba(255, 255, 255, 0.1); border-bottom: none; }
.footer-links { margin-bottom: 15px; }
.footer-links a { color: rgba(255, 255, 255, 0.7); text-decoration: none; margin: 0 10px; transition: color 0.3s ease; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-links span { color: rgba(255, 255, 255, 0.4); }

/* --- Hero Section --- */
.hero-section { padding: 100px 0; text-align: center; }
.hero-title { font-size: 4rem; margin-bottom: 20px; line-height: 1.2; }
.hero-subtitle { font-size: 1.25rem; max-width: 600px; margin: 0 auto 50px auto; opacity: 0.9; }
.relationship-selector { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; max-width: 800px; margin: 0 auto; }
.btn {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff; backdrop-filter: blur(10px);
    padding: 15px 30px; border-radius: 50px; font-size: 1rem;
    font-weight: 600; cursor: pointer; transition: all 0.3s ease;
    text-decoration: none;
}
.btn:hover { background-color: rgba(255, 255, 255, 0.3); transform: translateY(-3px); }

/* --- Journey & Content Sections --- */
.journey-section, .cta-section { padding: 100px 0; text-align: center; }
.journey-waypoint { max-width: 700px; margin: 0 auto 80px auto; }
.journey-waypoint p, .cta-section p { font-size: 1.1rem; opacity: 0.9; }
.cta-btn { font-size: 1.2rem; padding: 20px 40px; margin-top: 30px; display: inline-block; }

/* --- Language Details Section --- */
.language-details-section { padding: 60px 0; }
.language-row {
    /* We removed the grid here, each article will now be a full-width block */
    margin-bottom: 80px;
}
/* We no longer need rules for .language-image-col or .row-reverse */

.language-text-col { 
    /* Center the text and limit its width for readability */
    text-align: center; 
    max-width: 750px; /* Adjust as needed */
    margin: 0 auto;   /* This centers the block */
}
.language-text-col h3 { font-size: 2.2rem; color: #fff; margin-bottom: 20px; }
.language-text-col p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 30px; }
.language-text-col h4 {
    font-family: var(--font-body); font-weight: 600; font-size: 1rem;
    color: #fff; opacity: 0.95; text-transform: uppercase;
    letter-spacing: 1px; margin-bottom: 15px;
}
.language-text-col ul { 
    list-style: none; 
    padding-left: 0; 
    display: inline-block; /* Helps center the list items correctly */
    text-align: left;      /* Aligns the list text to the left within the centered block */
}
.language-text-col ul li { padding-left: 25px; position: relative; margin-bottom: 10px; opacity: 0.9; }
.language-text-col ul li::before {
    content: '✓'; position: absolute; left: 0;
    color: var(--primary-color); font-weight: 600;
}








/* --- Scroll Animations --- */
.fade-in-section {
    opacity: 0; /* This makes it invisible */
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in-section.is-visible { opacity: 1; transform: translateY(0); }
.animate-on-load { opacity: 0; animation: fadeIn 1s ease-out forwards; }
.hero-title.animate-on-load { animation-delay: 0.2s; }
.hero-subtitle.animate-on-load { animation-delay: 0.4s; }
#welcome-screen.animate-on-load { animation-delay: 0.6s; }
@keyframes fadeIn { to { opacity: 1; } }

/* --- QUIZ & RESULTS PAGE STYLES (for quiz.php) --- */
main:not(.homepage):not(.legal-page) { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
#quiz-screen, #results-screen {
   
    backdrop-filter: blur(15px);
    text-align: center; color: var(--text-color-light);
}
#quiz-screen h2, #results-screen h2 { color: #fff; font-size: 2rem; }
#results-screen h3 { font-size: 1.2rem; }
#progress-container { width: 100%; background-color: rgba(0,0,0,0.2); border-radius: 20px; margin-bottom: 30px; height: 12px; }
#progress-bar { height: 100%; width: 0%; background: var(--primary-color); border-radius: 20px; transition: width 0.4s ease-in-out; }
#options-container { display: flex; flex-direction: column; gap: 12px; margin: 30px 0; }
.option {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px; padding: 15px; cursor: pointer; text-align: center; width: 100%;
    font-size: 1rem; font-family: var(--font-body); color: var(--text-color-light); transition: all 0.3s ease;
}
.option:hover { border-color: rgba(255, 255, 255, 0.5); background-color: rgba(255, 255, 255, 0.2); }
.option.selected { border-color: var(--primary-color); background-color: rgba(255, 138, 138, 0.2); font-weight: 600; }
#validation-message { color: #ffc6c6; text-align: center; min-height: 1.5em; font-weight: 500; }
#next-btn { border-radius: 50px; }
#primary-language-text { font-size: 2rem; color: #fff; display: block; margin: 5px 0 15px 0; }
#results-chart { width: 100%; margin: 30px 0; text-align: left; }
.result-bar { display: flex; align-items: center; margin-bottom: 10px; }
.result-bar-label { width: 150px; font-weight: 500; font-size: 0.95rem; }
.result-bar-wrapper { flex-grow: 1; background-color: rgba(0,0,0,0.2); border-radius: 5px; }
.result-bar-fill {
    background-color: rgba(255, 255, 255, 0.5); color: #fff; height: 20px; border-radius: 5px; text-align: right;
    padding-right: 5px; font-size: 0.8rem; line-height: 20px; white-space: nowrap; font-weight: 600;
}
.result-bar.primary .result-bar-fill { background-color: #fff; color: var(--text-color-dark); }
#personalized-tips { background-color: rgba(0,0,0,0.2); padding: 20px; border-radius: 12px; margin: 25px 0; text-align: left;}
#personalized-tips h3 { color: #fff; }
.results-actions { display: flex; gap: 15px; justify-content: center; }
.btn-secondary {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff; backdrop-filter: blur(10px);
    display: inline-block; width: auto; padding: 10px 20px; border-radius: 50px; font-size: 0.9rem;
    font-weight: 600; cursor: pointer; text-align: center;
    transition: all 0.3s ease; margin-top: 10px;
}
.btn-secondary:hover { background-color: rgba(255, 255, 255, 0.1); }

/* --- Legal Page Styles --- */
.legal-page .container {

    padding: 40px 50px;
    margin-top: 50px;
    margin-bottom: 50px;
}
.legal-page h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #fff;
}
.legal-page h2 {
    font-size: 1.8rem;
    margin-top: 30px;
    margin-bottom: 15px;
    text-align: left;
    color: #fff;
}
.legal-page p {
    margin-bottom: 15px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .language-row {
        grid-template-columns: 1fr;
        gap: 30px; margin-bottom: 60px;
    }
    .language-row.row-reverse .language-image-col { order: -1; } /* This is the fix */
    .language-image-col { min-height: 250px; }
}
@media (max-width: 768px) {
    h2 { font-size: 2rem; }
    .hero-title { font-size: 2.8rem; }
    .header-container { flex-direction: column; gap: 15px; }
    #quiz-screen, #results-screen { padding: 30px 25px; }
    .legal-page .container { padding: 30px 25px; }
}

/* --- Print Styles for Browser --- */
.pdf-header {
    display: none;
}

@media print {
    /* Hide elements not meant for printing */
    .site-header, .site-footer, #quiz-screen, .results-actions, .language-switcher-container {
        display: none;
    }

    /* Reset body styles for printing */
    body { 
        background: none; 
    }
    
    /* Ensure the results screen and its contents are visible and styled for paper */
    #results-screen, #results-screen * { 
        visibility: visible; 
    }
    #results-screen {
        position: absolute; 
        left: 0; 
        top: 0; 
        width: 100%; 
        max-width: 100%;
        margin: 0; 
        padding: 40px; 
        border: none; 
        box-shadow: none; 
        border-radius: 0;
    }
    .pdf-header {
        display: block; 
        visibility: visible; 
        text-align: center;
        margin-bottom: 30px; 
        padding-bottom: 20px; 
        border-bottom: 1px solid #ddd;
    }
    #results-screen, #results-screen h2, #results-screen h3, #results-screen p,
    #results-screen strong, #results-screen .result-bar-label { 
        color: #000 !important; 
    }
    .result-bar-wrapper { background-color: #f0f0f0 !important; }
    .result-bar-fill { background-color: #cccccc !important; color: #000 !important; }
    .result-bar.primary .result-bar-fill { background-color: #888888 !important; color: #fff !important; }
    #personalized-tips { background-color: #f5f5f5 !important; border: 1px solid #eee; }
}

/* --- START: 404 Error Page Styles --- */
.error-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
    padding: 20px;
}
.error-page-container h1 {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 1rem;
}
.error-page-container p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}
/* --- END: 404 Error Page Styles --- */






 /* CSS for the language switcher buttons */
 .language-switcher-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0 40px 0;
    font-family: 'Inter', sans-serif;
}
.language-switcher-box {
    padding: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    max-width: 800px;
}
.lang-label {
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
    margin-right: 12px;
}
.lang-button {
    display: inline-block;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}
.lang-button:hover {
    border-color: #6ff112;
    color: #6ff112;
}
.lang-button.active {
    /* This is the style for the selected language */
    background-color: #48bb78; /* Green background */
    color: #ffffff;
    border-color: #48bb78;
    font-weight: 600;
}