/* --- Global Styles & Variables --- */
:root {
    --font-family-sans: 'Lato', 'Poppins', sans-serif;
    --font-family-serif: 'Merriweather', 'Lora', serif;
    
    /* NEW Light Theme Palette (Purple/Blue) */
    --background-color: #f4f7fa; /* Softer, slightly blue-ish white */
    --white-color: #FFFFFF;
    --text-color-dark: #1a202c; /* Deeper black */
    --text-color-light: #4a5568;
    --text-muted: #718096;
    --border-color: #dce4ed;

    /* NEW Accents (Purple/Indigo) */
    --primary-color: #673ab7; /* Deep Purple */
    --primary-hover: #5e35a1; /* Darker Purple */
    --primary-light: #ede7f6; /* Very Light Purple */

    /* Result Level Colors (Adjusted) */
    --level-low-color: #4CAF50;      /* Green */
    --level-mild-color: #FFC107;     /* Amber */
    --level-moderate-color: #FF5722; /* Deep Orange */
    --level-strong-color: #E53935;   /* Red */

    /* Radii & Shadows (Slightly more modern) */
    --border-radius-xl: 16px;
    --border-radius-lg: 12px;
    --border-radius-md: 8px;
    --shadow-main: 0 8px 25px rgba(26, 32, 44, 0.08);
}

body {
    font-family: var(--font-family-sans);
    color: var(--text-color-light);
    margin: 0;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    zoom:0.9;
}

main {
    flex: 1;
    display: block;
}

.container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

h1, h2, h3 {
    font-family: var(--font-family-serif);
    color: var(--text-color-dark);
    font-weight: 700;
}




/* --- Header & Footer --- */
.site-header { 
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.scrolled {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.header-container { display: flex; justify-content: space-between; align-items: center; }
.logo-link { text-decoration: none; }
.logo-link h1 { margin: 0; font-size: 1.25em; color: var(--text-color-dark); font-family: var(--font-family-sans); font-weight: 700; }
.main-nav { display: flex; align-items: center; gap: 1rem; }
.site-footer { padding: 2.5rem 0; text-align: center; color: var(--text-muted); background-color: transparent; border-top: 1px solid var(--border-color); margin-top: 4rem; }
.copyright { font-size: 0.9em; margin: 0; }

/* --- Buttons --- */
.btn { display: inline-block; padding: 0.9rem 2.2rem; border-radius: var(--border-radius-md); font-size: 1em; font-weight: 600; cursor: pointer; text-decoration: none; transition: all 0.3s ease; border: 1px solid var(--primary-color); background-color: var(--primary-color); color: var(--white-color); }
.btn.btn-large { padding: 1.1rem 2.8rem; font-size: 1.1em; color: white; }
.btn:hover { background-color: var(--primary-hover); border-color: var(--primary-hover); transform: translateY(-3px); box-shadow: 0 4px 15px rgba(103, 58, 183, 0.25); }
.btn.btn-header { padding: 0.6rem 1.2rem; font-size: 0.9em; background-color: var(--primary-light); color: var(--primary-color); border-color: var(--primary-light); }
.btn.btn-header:hover { background-color: var(--primary-color); color: var(--white-color); border-color: var(--primary-color); }

/* --- General Nav Styling --- */
.nav-link { text-decoration: none; color: var(--text-color-light); font-weight: 500; font-size: 0.9em; padding: 0.6rem 0.5rem; border-radius: var(--border-radius-md); transition: color 0.2s ease, background-color 0.2s ease; }
.nav-link:hover { color: var(--primary-color); background-color: var(--primary-light); }

/* --- Quiz Box --- */
.quiz-box { max-width: 700px; width: 100%; margin: 4rem auto; padding: 2.5rem; }
#question-wrapper { transition: opacity 0.3s ease-in-out; }
.progress-container { height: 8px; background-color: var(--border-color); border-radius: 4px; margin-bottom: 1rem; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background-color: var(--primary-color); transition: width 0.4s ease; }
.progress-text { text-align: center; color: var(--text-muted); font-size: 0.9em; margin-bottom: 2rem; }
.question-text { font-size: 1.5em; font-weight: 600; min-height: 90px; display: flex; align-items: center; justify-content: center; text-align: center; margin: 1.5rem 0 2.5rem; color: var(--text-color-dark); }
.options-container { display: grid; grid-template-columns: 1fr; gap: 0.8rem; }
.option input[type="radio"] { opacity: 0; position: absolute; }
.option label { display: block; padding: 1rem; border: 1px solid var(--border-color); border-radius: var(--border-radius-md); cursor: pointer; transition: all 0.2s ease; text-align: center; background-color: white; }
.option label:hover { border-color: var(--primary-color); background-color: var(--primary-light); }
.option input[type="radio"]:checked + label { background-color: var(--primary-color); color: var(--white-color); border-color: var(--primary-color); font-weight: 600; }

/* --- HOMEPAGE SEO SECTIONS --- */
.content-section { padding: 4.5rem 1rem; text-align: center; }
.content-section.bg-light { background-color: var(--white-color); }
.narrow-container { max-width: 800px; margin: 0 auto; }
.content-section h2 { font-size: 2.25em; margin-bottom: 1.5rem; }
.content-section p { font-size: 1.1em; color: var(--text-muted); line-height: 1.8; }
.hero-section-new { text-align: center; padding: 6rem 1rem; background-color: var(--white-color); }
.hero-section-new h1 { font-size: 3.25em; line-height: 1.2; margin-bottom: 1rem; }
.hero-section-new .subtitle { font-size: 1.25em; max-width: 650px; margin: 0 auto 2.5rem; color: var(--text-muted); }
/* Removed .features-grid, .feature-item, .feature-icon rules */
.subtypes-list article { background-color: var(--white-color); padding: 1.5rem 2rem; border-radius: var(--border-radius-md); margin-bottom: 1rem; text-align: left; border-left: 4px solid var(--primary-color); box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.subtypes-list h3 { margin-top: 0; font-family: var(--font-family-sans); font-weight: 600; }
.subtypes-list p { font-size: 1em; margin: 0; }
.faq-list { margin-top: 3rem; text-align: left; }
.faq-item { border-bottom: 1px solid var(--border-color); padding: 1.5rem 0; }
.faq-item:first-child { border-top: 1px solid var(--border-color); }
.faq-item h3 { font-family: var(--font-family-sans); font-size: 1.15em; font-weight: 600; margin: 0 0 0.5rem; }
.faq-item p { font-size: 1em; margin: 0; }
/* Removed .disclaimer-section rules */

/* --- BPD CRITERIA LIST (NEW STYLE) --- */
.criteria-list-new { list-style: none; padding-left: 0; margin-top: 3rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.criteria-list-new li { background-color: var(--white-color); padding: 1.5rem; border-radius: var(--border-radius-lg); font-weight: 500; color: var(--text-color-dark); text-align: left; position: relative; box-shadow: 0 4px 15px rgba(0,0,0,0.05); font-size: 1.05em; display: flex; align-items: center; border: 1px solid var(--border-color); padding-left: 3.5rem; }
.criteria-list-new li:before { content: counter(list-item); counter-increment: list-item; position: absolute; left: 1.25rem; top: 50%; transform: translateY(-50%); font-weight: 700; font-family: var(--font-family-serif); color: var(--primary-color); font-size: 1.25em; }
.criteria-list-new li:last-child { grid-column: 1 / -1; }
.criteria-list-new { counter-reset: list-item; }

/* --- Text Content Pages (About, Privacy, Terms) --- */
.text-content-card { background-color: var(--white-color) ; padding: 3rem 4rem; max-width: 800px; margin: auto; text-align: left; }
.text-content-card h2 { font-family: var(--font-family-sans); font-weight: 600; margin-top: 2.5rem; margin-bottom: 1rem; font-size: 1.5em; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
.text-content-card p { font-size: 1.05em; line-height: 1.8; color: var(--text-color-light); margin-bottom: 1rem; }
.text-content-card a { color: var(--primary-color); font-weight: 600; text-decoration: none; transition: opacity 0.2s; }
.text-content-card a:hover { text-decoration: underline; opacity: 0.8; }

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 950px) { .result-card { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
    .content-section h2, .hero-section-new h1 { font-size: 2em; }
    .hero-section-new { padding: 4rem 1rem; }
    .content-section { padding: 3rem 1rem; }
    .result-main-panel, .result-details-panel { padding: 2rem; }
    .criteria-list-new { grid-template-columns: 1fr; }
    .criteria-list-new li:last-child { grid-column: auto; }
    .text-content-card { padding: 2rem; }
}

/* --- Styling for Text Content Pages --- */
.text-content-card .last-updated { font-style: italic; color: var(--text-muted); font-size: 0.9em; margin-top: -1rem; margin-bottom: 2rem; }
.text-content-card ul { list-style-type: '✔'; padding-left: 2rem; margin-bottom: 1rem; }
.text-content-card ul li { padding-left: 0.5rem; margin-bottom: 0.5rem; font-size: 1.05em; line-height: 1.8; color: var(--text-color-light); }

/* --- Result Action Buttons --- */
.result-actions { display: flex; justify-content: center; gap: 15px; margin-top: 25px; padding-bottom: 40px; }
.btn-secondary { background-color: #f4f4f5; color: #333; border: 1px solid #d4d4d8; padding: 12px 24px; border-radius: var(--border-radius-md); font-weight: 500; cursor: pointer; transition: background-color 0.2s ease, box-shadow 0.2s ease; text-decoration: none; font-size: 1rem; }
.btn-secondary:hover { background-color: #e4e4e7; border-color: #a1a1aa; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.btn-secondary:disabled { background-color: #e9ecef; color: #6c757d; cursor: not-allowed; border-color: #ced4da; }


/* --- STYLING FOR EMBEDDED QUIZ --- */
#quiz-section .quiz-box {
    margin-top: 0;
    margin-bottom: 0;
    padding: 2rem 2.5rem;
    background-color: var(--white-color);
}

@media (max-width: 768px) {
    #quiz-section .quiz-box {
        padding: 1.5rem;
    }
}


/* --- HIDE QUIZ INITIALLY --- */
#quiz-section {
    display: none;
}

/* --- STYLING FOR HOMEPAGE LANGUAGE SWITCHER --- */
.language-switcher-section {
    padding: 3rem 1rem; /* Less padding than other sections */
}

.language-switcher-section h2 {
    font-size: 1.8em; /* Slightly smaller title */
    margin-bottom: 2rem;
}

.language-links {
    display: flex;
    flex-wrap: wrap; /* Allow links to wrap on smaller screens */
    justify-content: center; /* Center the links */
    gap: 1rem; /* Space between links */
}

.language-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--white-color);
    color: var(--text-color-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    text-decoration: none;
    font-weight: 500;
    font-size: 1em;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.language-link:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.language-link.active {
    background-color: var(--primary-color);
    color: var(--white-color);
    border-color: var(--primary-color);
    font-weight: 600;
    cursor: default; /* Indicate it's the current language */
    box-shadow: none;
    transform: none;
}


/* --- NEW RESULT PAGE DESIGN (UNIQUE LAYOUT) --- */

/* 1. Remove old grid layout and styles */
.result-card {
    display: block; /* Remove grid */
    grid-template-columns: none;
    max-width: none;
    margin: 0;
    box-shadow: none;
    overflow: visible;
    border: none;
    background-color: transparent;
}
.result-main-panel, .result-details-panel {
    padding: 0; /* Remove padding from old containers */
}

/* 2. Style new containers */
.result-page-new .container {
    max-width: 900px; /* Constrain the new layout */
}
.result-download-wrapper {
    background-color: var(--white-color); /* White background for the PDF content */
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-main);
    border: 1px solid var(--border-color);
    overflow: hidden; /* Ensures border-radius clips content */
    margin-top: 4rem;
}

/* 3. Hero Panel (Score & Title) */
.result-hero-panel {
    padding: 3rem;
    color: var(--white-color);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Apply a subtle gradient instead of solid color */
    background-image: linear-gradient(145deg, 
        var(--level-color-light, #888), 
        var(--level-color-dark, #555)
    );
}

/* Set up variables for the gradients */
.result-hero-panel.level-low {
    --level-color-light: #66bb6a;
    --level-color-dark: #388e3c;
}
.result-hero-panel.level-mild {
    --level-color-light: #ffca28;
    --level-color-dark: #ffa000;
}
.result-hero-panel.level-moderate {
    --level-color-light: #ff7043;
    --level-color-dark: #e64a19;
}
.result-hero-panel.level-strong {
    --level-color-light: #ef5350;
    --level-color-dark: #c62828;
}

/* Neutralize old background-color rules */
.result-main-panel.level-low,
.result-main-panel.level-mild,
.result-main-panel.level-moderate,
.result-main-panel.level-strong {
    background-color: transparent; 
}

.result-hero-panel h1 {
    color: var(--white-color);
    font-size: 2.2em;
    line-height: 1.3;
}
.result-hero-panel .result-intro-subtitle {
    display: block;
    font-size: 0.9em;
    font-weight: 500;
    opacity: 0.8;
}
.result-hero-panel .score-container {
    margin: 2rem 0;
}
.result-hero-panel .score-gauge {
     width: 150px; 
     height: 150px; 
     /* Keep the cool gauge effect */
     background: conic-gradient(white calc(var(--score-percent) * 1%), rgba(255, 255, 255, 0.3) 0);
}
.result-hero-panel .score-gauge::before {
     filter: none; /* Remove the invert filter */
     background: rgba(0,0,0,0.2); /* Dark inner circle */
     inset: 15px;
}
.result-hero-panel .score-value {
    font-size: 2.5em;
    font-weight: 700;
    position: relative;
    color: var(--white-color);
}
.result-hero-panel .score-label {
    display: block;
    margin-top: 1rem;
    font-size: 0.9em;
    opacity: 0.8;
}
.result-hero-panel .result-interpretation {
    max-width: 500px; /* Wider for full-width layout */
    margin-bottom: 0; /* Remove bottom margin */
    opacity: 0.9;
    font-size: 1.1em;
}

/* Hide the old retake button */
.btn-retake {
    display: none; 
}

/* 4. Details Grid (Key Areas & Next Steps) */
.result-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0;
}
.result-content-card {
    padding: 2.5rem;
}
/* Add a border to separate the two cards */
.result-content-card:first-child {
    border-right: 1px solid var(--border-color);
}
.result-content-card h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.4em;
    color: var(--text-color-dark);
}
.result-content-card p {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}
/* Tweak next steps list for new card */
.next-steps-list li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.next-steps-list li::before {
    font-size: 1.2em;
    top: 3px;
}
.next-steps-list li strong {
    display: block;
    color: var(--text-color-dark);
}
.next-steps-list li span {
    font-size: 0.95em;
}

/* 5. Action Buttons (Unified) */
.result-actions {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on mobile */
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-bottom: 4rem;
}
/* Style the new retake button (which is an <a> tag) like the others */
.result-actions .btn-secondary {
    padding: 0.9rem 2.2rem;
    font-size: 1em;
    min-width: 200px; /* Give them some width */
    text-align: center;
}

/* --- RESPONSIVE ADJUSTMENTS FOR NEW LAYOUT --- */
@media (max-width: 950px) {
    /* Stack the grid items */
    .result-details-grid {
        grid-template-columns: 1fr;
    }
    .result-content-card:first-child {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}
@media (max-width: 768px) {
    .result-download-wrapper { margin-top: 2rem; }
    .result-hero-panel { padding: 2rem; }
    .result-content-card { padding: 2rem; }
    .result-hero-panel h1 { font-size: 1.8em; }
    .result-actions .btn-secondary {
        width: 100%; /* Full width buttons on mobile */
        min-width: 0;
    }
}


/* =====================================================
--- STYLES MOVED FROM PHP & MOBILE FIXES ---
===================================================== */

/* --- STYLES MOVED FROM PHP FILES --- */

/* Style for the container on About, Privacy, etc. */
.page-container {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

/* Style for the links in the footer */
.footer-links {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap; /* Added for safety */
}

/* New rule for footer links (from inline style) */
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}
.footer-links a:hover {
    text-decoration: underline;
}

/* =====================================================
--- NEW MOBILE RESPONSIVE STYLES ---
=====================================================
*/
@media (max-width: 768px) {

  /* Hide the header on mobile, as requested */
  .site-header {
    display: none;
  }

  /* Reduce hero section fonts */
  .hero-section-new h1 {
    font-size: 2.25em; /* Was 3.25em */
  }
  .hero-section-new .subtitle {
    font-size: 1.1em; /* Was 1.25em */
  }
  
  /* Reduce other section titles */
  .content-section h2 {
    font-size: 1.8em; /* Was 2.25em */
  }

  /* Reduce padding on text/content pages */
  .text-content-card {
    padding: 1.5rem; /* Was 3rem 4rem */
  }

  /* Reduce padding on homepage sections */
  .hero-section-new {
    padding: 3rem 1rem; /* Was 6rem 1rem */
  }
  .content-section {
    padding: 2.5rem 1rem; /* Was 4.5rem 1rem */
  }

  /* Reduce padding for the main page container (About, etc) */
  .page-container {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  /* Reduce quiz box padding */
  .quiz-box {
    padding: 1.5rem; /* Was 2.5rem */
  }
  #quiz-section .quiz-box {
    padding: 1.5rem; /* Was 2rem 2.5rem */
  }
  
  /* Make question text smaller */
  .question-text {
    font-size: 1.25em; /* Was 1.5em */
    min-height: 0;
  }

  /* Stack footer links vertically */
  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .language-link {
    padding: 0.6rem 1.2rem;
    font-size: 0.9em;
  }
  
  .criteria-list-new {
    grid-template-columns: 1fr;
  }
  .criteria-list-new li:last-child {
    grid-column: auto;
  }
  
  /* Stack result page details */
  .result-details-grid {
    grid-template-columns: 1fr;
  }
  .result-content-card:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .result-download-wrapper {
    margin-top: 2rem;
  }
  .result-hero-panel {
    padding: 2rem;
  }
  .result-content-card {
    padding: 2rem;
  }
  .result-hero-panel h1 {
    font-size: 1.8em;
  }
  .result-actions .btn-secondary {
    width: 100%;
    min-width: 0;
  }
}