* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #ffffff; /* White for all main sections */
    color: #333;
}

/* =========================
   SLIMMER HEADER + NAVIGATION
   ========================= */

header {
    background-color: #0E2668 !important;
    padding: 2px 0; /* 🔹 reduced from 6px → 2px for slimmer bar */
}

/* Navigation wrapper (initial defaults; overridden later for header specifically) */
nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    gap: 2px; /* 🔹 minimal space between logo and links */
}

/* Logo container */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2px; /* 🔹 less space between logo and nav */
}

/* Slimmer logos */
.logo {
    width: 95px; /* 🔹 reduced from 120px */
    height: auto;
}

.AI-DrivenMPG_logo {
    width: 200px; /* 🔹 reduced from 250px */
    height: auto;
}

/* Navigation list */
ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap; /* ✅ wrap to second row if needed */
    justify-content: center;
    gap: 6px 10px;
    padding: 0;
    margin: 0 auto;
    max-width: 95%;
}

/* Nav links */
nav ul li a {
    text-decoration: none;
    color: #0E2668;
    font-weight: bold;
    font-size: 13px; /* 🔹 smaller text for slimmer look */
    padding: 4px 10px; /* 🔹 reduced padding height */
    border-radius: 5px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    display: inline-block;
    white-space: nowrap;
}

/* Hover effect */
nav ul li a:hover {
    background-color: #0E2668;
    color: #ffffff;
}

/* Sign-out / gold button */
.sign-up-button {
    background-color: #FFD700;
    color: #0E2668;
    font-weight: bold;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.sign-up-button:hover {
    background-color: #ffffff;
    color: #0E2668;
}

/* =========================
   SECTIONS + PAGE CONTENT
   ========================= */

.section {
    padding: 60px;
    text-align: center;
    background-color: #ffffff;
}

.home-section {
    display: flex;
    justify-content: center;
    padding: 80px 20px;
}

.content-container {
    display: flex;
    max-width: 1200px;
    width: 100%;
}

.left-content {
    text-align: left;
    margin-right: 60px;
}

h1 {
    color: #0E2668;
    font-weight: bold;
    font-size: 2.5em;
    margin-bottom: 20px;
}

h2 {
    font-size: 2.5rem;
    color: #0E2668;
}

.intro-text {
    margin-top: 20px;
    font-size: 1.2rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 40px;
    text-align: justify;
}

/* Login Form */
.login-form {
    background-color: #f8f8f8;
    padding: 40px;
    border-radius: 10px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

.login-form h3 {
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: bold;
    color: #0E2668;
}

.login-input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 2px solid #0E2668;
    border-radius: 5px;
    color: black;
    font-size: 1em;
}

.login-input::placeholder {
    color: #333;
    opacity: 0.6;
}

.login-button {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 20px;
    background-color: #FFD700;
    color: #0E2668;
    text-decoration: none;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.login-button:hover {
    background-color: #0E2668;
    color: #ffffff;
}

.terms {
    font-size: 0.9em;
    color: #4a4a4a;
    margin-top: 15px;
}

.terms a {
    color: #0E2668;
    font-weight: bold;
}

/* Features */
.feature-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    gap: 30px;
    margin-top: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-s {
    font-size: 20px;
    font-weight: bolder;
}

.feature img {
    display: block;
    margin: 0 auto;
}

.feature {
    flex: 1 1 calc(33.333% - 40px);
    max-width: 350px;
    box-sizing: border-box;
}

/* Sign Up Form */
.sign-up-section {
    padding: 60px;
}

.sign-up-form {
    max-width: 400px;
    margin: 0 auto;
    background-color: #f8f8f8;
    padding: 40px;
    border-radius: 10px;
}

/* Footer */
footer {
    background-color: #0E2668;
    padding: 20px;
    text-align: center;
    color: #ffffff;
}

footer a {
    color: #FFD700;
    text-decoration: none;
    font-weight: bold;
}

/* Text Elements */
p {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 20px;
    max-width: 700px;
    margin: 0 auto;
}

ol {
    list-style-type: none;
    padding: 0;
    margin: 20px auto;
    max-width: 800px;
    text-align: left;
}

ol li {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #555;
}

/* Icon Boxes */
.icon-box {
    flex: 1 1 calc(33.333% - 40px);
    max-width: 350px;
    box-sizing: border-box;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    background-color: #f8f8f8;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.icon-box:hover {
    transform: translateY(-5px);
    box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.15);
}

.icon-box img {
    width: 250px;
    margin-bottom: 15px;
}

.icon-box h4 {
    font-size: 1.5rem;
    color: #0E2668;
    margin-bottom: 10px;
}

.icon-box p {
    font-size: 1rem;
    color: #333;
    line-height: 1.4;
}

.icons-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Contact Us */
.contact-heading {
    font-size: 2.5rem;
    color: #0E2668;
    margin-bottom: 20px;
    font-weight: bold;
}

.email-text {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.email-link {
    color: #0E2668;
    text-decoration: none;
    font-weight: bold;
}

.contact-content {
    margin: 0 auto;
    max-width: 100%;
    line-height: 1.6;
    font-size: 1.1rem;
    color: #555;
    text-align: justify;
}

.contact-content p {
    margin-bottom: 20px;
}

/* Success & Error Messages */
.success-message, .error-message {
    max-width: 600px;
    margin: 30px auto;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.success-message h3, .error-message h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.success-message p, .error-message p {
    font-size: 1.1rem;
    margin-top: 0;
}

/* Search */
.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 10px;
    position: relative;
}

.search-form {
    display: flex;
    align-items: center;
    width: 50%;
    max-width: 500px;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.search-form input {
    width: 80%;
    padding: 8px;
    border: none;
    outline: none;
    border-radius: 5px;
}

.search-form button {
    width: 20%;
    background-color: #FFD700;
    color: #0E2668;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.search-form button:hover {
    background-color: #0E2668;
    color: #ffffff;
}

#suggestions {
    position: absolute;
    width: 100%;
    max-width: 500px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    display: none;
    z-index: 10;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 5px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    text-align: left;
}

#suggestions div {
    padding: 10px;
    cursor: pointer;
}

#suggestions div:hover {
    background-color: #f0f0f0;
}

/* Buttons & Boxes */
button,
.sign-up-button,
.login-button,
.search-form button {
    padding: 12px 20px;
    font-size: 1rem;
    background-color: #FFD700;
    color: #0E2668;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover,
.sign-up-button:hover,
.login-button:hover,
search-form button:hover {
    background-color: #0E2668;
    color: #ffffff;
}

.login-form,
.sign-up-form,
.icon-box {
    border-radius: 10px;
    padding: 40px;
    background-color: #f8f8f8;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

/* Signed-in layout */
.user-dashboard-container,
.user-contactus-container,
.user-budget-container,
.user-plan-container,
.user-analyze-container,
.user-recommendation-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
    background-color: #f8f8f8;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

/* Titles */
h1, h2, .presentation-title {
    font-variant: small-caps;
    font-size: 2.8rem;
    letter-spacing: 1px;
    font-weight: bold;
    color: #0E2668;
    text-align: center;
    margin-bottom: 20px;
}

/* =====================================================
   HEADER FIXES — Unified Layout
   (These restore the old layout: logos left, tabs right)
   ===================================================== */

header nav {
    /* FORCE a single row for before-login pages */
    flex-direction: row !important;          /* ✅ stop stacking */
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    padding: 4px 30px !important;            /* slim top bar */
}

header .logo-container {
    justify-content: flex-start !important;  /* ✅ logos far left */
    align-items: center !important;
    gap: 15px !important;
    margin-bottom: 0 !important;             /* remove extra gap */
}

header ul {
    /* ✅ tabs far right (one row) */
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 12px !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
}

header ul li { list-style: none; }

header ul li a {
    text-decoration: none;
    background: #ffffff;
    color: #0E2668;
    font-weight: bold;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

header ul li a:hover {
    background-color: #0E2668;
    color: #ffffff;
}

/* Keep the Sign Up/Sign Out button gold */
header ul li .sign-up-button {
    background-color: #FFD700 !important;
    color: #0E2668 !important;
    font-weight: bold;
}

/* =====================================================
   AFTER LOGIN HEADER (2 tidy rows on right)
   ===================================================== */

.user-header {
    background-color: #0E2668 !important;
    padding: 6px 0; /* slim but readable */
}

.user-header .user-nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0 30px;
    gap: 12px;
}

.user-header .logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: flex-start;
}

.user-header .nav-right {
    display: grid;                         /* ✅ grid for perfect 5 x 2 */
    grid-template-columns: repeat(5, max-content);
    grid-auto-rows: auto;
    column-gap: 16px;
    row-gap: 8px;
    justify-items: end;                    /* align each button right */
    justify-content: end;                  /* push grid to the right */
}

.user-header .nav-link {
    background: #ffffff;
    color: #0E2668;
    font-weight: bold;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 6px;
    min-width: 120px;                      /* same size boxes */
    text-align: center;
    display: inline-block;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.user-header .nav-link:hover {
    background: #0E2668;
    color: #ffffff;
}

.user-header .sign-out {
    background: #FFD700;
    color: #0E2668 !important;
    font-weight: bold;
    border-radius: 6px;
    padding: 6px 14px;
    min-width: 120px;
    text-align: center;
}

.user-header .sign-out:hover {
    background: #ffffff;
    color: #0E2668 !important;
}

/* Hide any legacy UL inside user header nav bars */
.user-header nav ul { display: none !important; }

/* Responsive: stack rows nicely on small screens */
@media (max-width: 1200px) {
    .user-header .nav-right {
        grid-template-columns: repeat(4, max-content);
    }
}
@media (max-width: 992px) {
    .user-header .user-nav {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    .user-header .nav-right {
        grid-template-columns: repeat(3, max-content);
        justify-items: center;
        justify-content: center;
    }
}
@media (max-width: 768px) {
    .user-header .nav-right { grid-template-columns: repeat(2, max-content); }
}
@media (max-width: 520px) {
    .user-header .nav-right { grid-template-columns: repeat(1, max-content); }
}

/* =====================================================
   UNIVERSAL FIXES: Alignment + Readability
   ===================================================== */

/* Lock full width for all user pages */
.user-page {
  width: 100%;
  overflow-x: hidden;
  background-color: #ffffff;
}

/* Force header to take full width */
.user-header, header {
  width: 100%;
  margin: 0 auto;
  display: block;
}

/* Keep logo + tabs perfectly aligned horizontally */
.user-header .user-nav,
header nav {
  max-width: 1400px;   /* same across all pages */
  margin: 0 auto;
}

/* Ensure uniform spacing between buttons */
header nav ul li {
    margin: 4px 6px !important;
}

/* Keep the Sign Out button gold always */
.sign-up-button {
    background-color: #FFD700 !important;
    color: #0E2668 !important;
    font-weight: bold;
}

/* Fix text readability on dark sections (Advisor & Assessment) */
.advisor-container,
.assessment-container,
.ai-insights,
.section-dark {
    color: #ffffff !important;
}

.advisor-container h2,
.assessment-container h2,
.ai-insights h4,
.ai-insights p,
.section-dark h2,
.section-dark p {
    color: #ffffff !important;
}

/* Adjust AI Insights panel contrast */
.ai-insights {
    background-color: #0E2668 !important;
    border-radius: 12px;
    padding: 20px;
    color: #ffffff !important;
}

.ai-insights strong,
.ai-insights span {
    color: #FFD700 !important; /* highlight key numbers */
}

/* Make overview and report cards cleaner */
.advisor-container .plan-card,
.assessment-container .report-box {
    background-color: #ffffff !important;
    color: #0E2668 !important;
}

/* Ensure slider labels and values are dark blue on white background */
input[type=range] + label,
input[type=range] + span,
.slider-label {
    color: #0E2668 !important;
}

/* Slight lift to readability across the board */
h2, h3, h4, h5, h6 {
    color: #0E2668 !important;
    font-weight: bold;
}

p, li {
    color: #333333 !important;
}

/* =====================================================
   HEADER FIXES — FINAL UNIFIED VERSION
   ===================================================== */

header, .user-header {
  width: 100%;
  background-color: #0E2668 !important;
  display: block;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Shared Navigation Layout (public + logged-in) */
header nav,
.user-header .user-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  max-width: 1400px;
  margin: 0 auto;
  padding: 6px 30px;
}

/* Logo section */
header .logo-container,
.user-header .logo-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 15px;
}

header .logo,
.user-header .logo {
  width: 95px;
  height: auto;
}

header .AI-DrivenMPG_logo,
.user-header .AI-DrivenMPG_logo {
  width: 200px;
  height: auto;
}

/* Navigation tabs */
header ul,
.user-header .nav-right {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

header ul li a,
.user-header .nav-link {
  background: #ffffff;
  color: #0E2668;
  font-family: Arial, sans-serif;
  font-weight: bold;
  font-size: 14px;             /* ✅ unified font size */
  padding: 6px 14px;           /* ✅ unified padding */
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  min-width: 120px;            /* ✅ equal button widths */
  transition: all 0.3s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

header ul li a:hover,
.user-header .nav-link:hover {
  background: #0E2668;
  color: #ffffff;
}

/* Sign Out / Sign Up buttons (gold) */
.sign-up-button,
.user-header .sign-out {
  background-color: #FFD700 !important;
  color: #0E2668 !important;
  font-weight: bold;
  border-radius: 6px;
  padding: 6px 14px;
  min-width: 120px;
  text-align: center;
}

.sign-up-button:hover,
.user-header .sign-out:hover {
  background-color: #ffffff !important;
  color: #0E2668 !important;
}

/* Responsive behavior */
@media (max-width: 1200px) {
  header nav,
  .user-header .user-nav {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }
  header ul,
  .user-header .nav-right {
    justify-content: center;
  }
}
@media (max-width: 768px) {
  header ul li a,
  .user-header .nav-link {
    font-size: 13px;
    min-width: 100px;
    padding: 5px 10px;
  }
}

/* =====================================================
   UNIVERSAL TEXT COLOR & READABILITY FIX
   ===================================================== */

h1, h2, h3, h4, h5, h6 {
  color: #0E2668 !important;
  font-family: Arial, sans-serif !important;
  font-weight: bold !important;
}

p, li {
  color: #333 !important;
  font-family: Arial, sans-serif !important;
}

.advisor-container,
.assessment-container,
.section-dark {
  color: #ffffff !important;
}

.advisor-container h2,
.assessment-container h2 {
  color: #ffffff !important;
}

/* =====================================================
   FIX: Readability for Assessment & Advisor Subtitles
   ===================================================== */

/* Shared subtitle style under titles */
.assessment-header p,
.advisor-header p {
  color: #0E2668 !important;       /* ✅ Navy Blue for readability */
  font-size: 1rem !important;
  font-weight: 500;
  text-align: center;
  line-height: 1.6;
  margin-top: 6px;
  margin-bottom: 12px;
  background: none !important;     /* prevent white text on white bg */
}

/* Optional: strengthen section background contrast if needed */
.assessment-container,
.advisor-container {
  background-color: #ffffff !important;  /* clean white background */
  color: #0E2668 !important;
}

/* Keep blue cards readable (inside advisor/assessment) */
.ai-summary, .ai-box {
  background-color: #0E2668 !important;
  color: #ffffff !important;
  border-radius: 10px;
  padding: 25px;
}



