/* Base setup (Matching BudgIT/Bimi Style) */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- BudgIT Color Variables --- */
:root {
  /* Light/Index Page Colors */
  --light-bg: #ffffff; /* White */
  --hero-bg: #ffffff; /* White */
  --heading-dark: #00586f; /* Bimi dark teal/blue for main heading */
  --text-dark: #003948; /* Darker text */
  --accent-button: #003948; /* Main 'Get Started' button */
  --topic-bg: #e6e6e6; /* Light gray for topic tags */
  --secondary-bg: #001b22; /* Dark section background */
  --secondary-text: #eeffff; /* Very light blue for secondary text */
  
  /* Feature Card Colors */
  --card-teal: #009694;
  --card-dark: #001b22;
  --card-blue: #00586f;
  
  /* Footer */
  --footer-bg: #001b22;
  --footer-text: #ffffff;

  /* Dark/Chat Page Colors (Dark mode default) */
  --dark-bg: #000b0d; /* Very dark chat background */
  --dark-element-bg: #303b3d; /* Input box/Active card background */
  --dark-text: #f0f7f9;
  --dark-text-secondary: #a9b5bd;
  --chat-input-border: #303b3d;
}

body {
  font-family: "cenios", Inter; /* Keep cenios */
  line-height: 1.2;
}

/* ------------------------------------- */
/* --- GENERAL LAYOUT & FONT SIZES --- */
/* ------------------------------------- */

.container {
  max-width: 1440px; /* Wider max width matching BudgIT */
  margin: 0 auto;
  padding: 0 20px;
}

.center {
  text-align: center;
}

/* Typography matching BudgIT (using large, fluid units) */
.hero h1 {
  font-size: 10.8rem; /* Equivalent to xl:text-[10.8rem] */
  line-height: 1;
  color: var(--heading-dark);
  margin-bottom: 0.2em;
}

.hero .subtitle {
  font-size: 1.5rem; /* Equivalent to xl:text-3xl */
  max-width: 800px;
  margin: 0 auto 3rem; /* Increased margin bottom */
  color: var(--text-dark);
}

.section-heading {
    font-size: 6rem; /* Equivalent to lg:text-8xl or lg:text-[6rem] */
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 2rem;
}

/* --- Navbar (Used on both index and chat pages) --- */
.navbar {
  background: var(--light-bg);
  box-shadow: 0px 2px 3px 0px rgba(0,0,0,0.1);
  position: sticky;
  z-index: 50;
  top: 0;
  height: 72px; /* Fixed height matching BudgIT */
  display: flex;
  align-items: center;
}
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    /* Use 20px padding to match general container padding and image */
    padding: 0 20px; 
}
.logo img { 
    width: 130px; /* Fixed width matching BudgIT */
    height: 42px; 
    object-fit: cover;
}

/* 'Get Started' Button on Index Page */
.btn-primary {
  background: var(--secondary-bg); /* Use the darker button color from the source */
  color: white;
  padding: 13px 27px;
  border-radius: 9999px; /* Rounded full */
  font-weight: 500;
  font-size: 1rem; /* text-xl */
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  transition: opacity 0.3s ease;
}
.btn-primary:hover {
  opacity: 0.9;
}


/* --- Hero Section --- */
.hero {
    /* Use flex to achieve vertical centering */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 72px); /* Full screen height minus navbar */
    padding: 3rem 0;
    background: var(--hero-bg);
}
.hero-content {
    max-width: 50%; /* lg:max-w-[50%] */
    padding-bottom: 5rem;
}

.hero .topics {
  margin-top: 3rem;
}
.hero h3 {
    color: #616161; /* Specific gray from source */
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}
.hero .tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px; /* sm:gap-3 md:gap-5 */
}
.hero .tags span {
  background: var(--topic-bg);
  color: #4a4a4a; /* A generic dark gray for text on light tags */
  padding: 8px 24px;
  border-radius: 9999px; 
  font-size: 1.1rem;
  box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
}

/* --- Video Section (How Bimi Works) --- */
.video-section {
  background: var(--secondary-bg);
  padding: 5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px; /* flex gap-11 */
}

.video-section h2 {
    color: white;
    font-size: 6rem; /* Match section-heading for lg */
    text-align: center;
}
.video-section .video-wrapper {
  width: 66%; /* sm:w-2/3 */
  max-width: 800px;
  aspect-ratio: 16 / 9;
}
.video-section iframe {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: none;
}
.video-section a {
    color: var(--secondary-text);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.3s;
}
.video-section a:hover {
    color: var(--card-teal); /* Hover color from source */
}
.video-section a svg {
    height: 1em;
    width: 1em;
}

/* --- Features Section (Simple, Yet Powerful) --- */
.features {
  background: var(--secondary-text); /* #EEFFFF */
  padding: 4rem 0 6rem;
}
.features-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
}
.features-header h3 {
    color: var(--secondary-bg); /* #001B22 */
    font-size: 6rem;
    margin-bottom: 1.6rem;
}
.features-header p {
    color: var(--secondary-bg);
    font-size: 1.6rem;
}

.features .cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Two columns */
    gap: 24px; /* gap-x-6 gap-y-4 */
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 38px;
}
.features .card {
    border-radius: 24px; /* rounded-3xl */
    padding: 48px; /* py-12 md:py-16 */
    color: white;
    display: flex;
    flex-direction: column;
}
.features .card.span-2 {
    grid-row: span 2 / span 2;
}

/* Card Specifics */
.features .card.teal { background: var(--card-teal); }
.features .card.dark { background: var(--card-dark); }
.features .card.blue { background: var(--card-blue); }

.features .card img {
    height: 70px; /* Fixed height for small icons */
    width: 70px;
    margin-bottom: 1rem;
    object-fit: contain;
}
.features .card.span-2 img {
    width: 200px; /* md:w-[200px] */
    height: 200px;
}

.features .card h4 {
    font-size: 1.5rem; /* text-2xl */
    font-weight: 600;
    margin-bottom: 1.5rem;
}
.features .card p {
    font-size: 1.25rem; /* text-xl */
    margin-bottom: 1.5rem;
}
.features .card a {
    color: white;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}
.features .card a:hover {
    color: #e2e8f0; /* slate-200 hover */
}

/* --- CTA Section --- */
.cta-section {
    background: var(--light-bg);
    padding: 6rem 0;
}
.cta-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20rem; /* lg:px-[20rem] */
    text-align: center;
    color: var(--secondary-bg);
}
.cta-content h2 {
    font-size: 6rem;
    margin-bottom: 2rem;
}
.cta-content p {
    font-size: 1.6rem; /* lg:text-[2rem] */
    margin-bottom: 3rem;
}
.cta-content .btn-primary {
    margin-bottom: 4rem; /* mb-16 */
}

/* --- Footer --- */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: 1.25rem; /* md:text-xl lg:text-2xl */
}
footer p {
    margin-bottom: 8px;
}
footer .links a {
    color: var(--footer-text);
    text-decoration: underline;
    margin: 0 10px;
}

/* ... (All your existing BudgIT/Bimi styles remain UNTOUCHED above this line) ... */

/* ------------------------------------- */
/* --- CHAT PAGE MIRRORED STYLES (New) --- */
/* ------------------------------------- */

/* Variable Mapping (Original mirrored script used these, mapped to your variables) */
:root {
    /* Dark mode colors - Mapping to your existing BudgIT vars */
    --mirrored-text-color: var(--dark-text);
    --mirrored-subheading-color: #828282;
    --mirrored-placeholder-color: var(--dark-text-secondary);
    --mirrored-primary-color: var(--dark-bg);
    --mirrored-secondary-color: var(--dark-element-bg);
    --mirrored-secondary-hover-color: #444;
}
.light_mode {
    /* Light mode colors - Mapping to your existing BudgIT vars */
    --mirrored-text-color: var(--text-dark);
    --mirrored-subheading-color: #a0a0a0;
    --mirrored-placeholder-color: #6c6c6c;
    --mirrored-primary-color: var(--light-bg);
    --mirrored-secondary-color: #e9eef6;
    --mirrored-secondary-hover-color: #dbe1ea;
}


body {
    /* Base background for the chat page only (overwrites the index background) */
    background: var(--mirrored-primary-color);
}
.chat-ai-body {
    /* Ensure the body remains flexible for full screen chat */
    min-height: 100vh;
}

.header,
.chat-list .message,
.typing-form {
    margin: 0 auto;
    max-width: 980px;
}
.header {
    margin-top: 6vh;
    padding: 1rem;
    overflow-x: hidden;
    /* Use a fixed height for the navbar to create space */
    padding-top: 2px; /* Pushes content down past the fixed .navbar */
}
body.hide-header .header {
    margin: 0;
    display: none;
}
.header :where(.title, .subtitle) {
    color: var(--mirrored-text-color);
    font-weight: 500;
    line-height: 4rem;
}
.header .title {
    width: fit-content;
    font-size: 3rem;
    background-clip: text;
    background: linear-gradient(to right, #4285f4, #d96570);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.header .subtitle {
    font-size: 2.6rem;
    color: var(--mirrored-subheading-color);
}
.suggestion-list {
    width: 100%;
    list-style: none;
    display: flex;
    gap: 1.25rem;
    margin-top: 9.5vh;
    overflow: hidden;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.suggestion-list .suggestion {
    cursor: pointer;
    padding: 1.25rem;
    width: 222px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    border-radius: 0.75rem;
    justify-content: space-between;
    background: var(--mirrored-secondary-color);
    transition: 0.2s ease;
}
.suggestion-list .suggestion:hover {
    background: var(--mirrored-secondary-hover-color);
}
.suggestion-list .suggestion :where(.text, .icon) {
    font-weight: 400;
    color: var(--mirrored-text-color);
}
.suggestion-list .suggestion .icon {
    width: 42px;
    height: 42px;
    display: flex;
    font-size: 1.3rem;
    margin-top: 2.5rem;
    align-self: flex-end;
    align-items: center;
    border-radius: 50%;
    justify-content: center;
    color: var(--mirrored-text-color);
    background: var(--mirrored-primary-color);
}
.chat-list {
    padding: 2rem 1rem 14rem; /* Increased bottom padding for footer/input area */
    max-height: calc(100vh - 72px); /* Calc height minus fixed navbar */
    overflow-y: auto;
    scrollbar-color: #999 transparent;
}
.chat-list .message.incoming {
    margin-top: 1.5rem;
}
.chat-list .message .message-content {
    display: flex;
    gap: 1.5rem;
    width: 100%;
    align-items: center;
}
.chat-list .message .text {
    color: var(--mirrored-text-color);
    white-space: pre-wrap;
}
.chat-list .message.error .text {
    color: #e55865;
}
.chat-list .message.loading .text {
    display: none;
}
.chat-list .message .avatar {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    align-self: flex-start;
}
.chat-list .message.loading .avatar {
    animation: rotate 3s linear infinite;
}
@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}
.chat-list .message .icon {
    color: var(--mirrored-text-color);
    cursor: pointer;
    height: 35px;
    width: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    font-size: 1.25rem;
    margin-left: 3.5rem;
    visibility: hidden;
}
.chat-list .message .icon.hide {
    visibility: hidden;
}
.chat-list .message:not(.loading, .error):hover .icon:not(.hide) {
    visibility: visible;
}
.chat-list .message .icon:hover {
    background: var(--mirrored-secondary-hover-color);
}
.chat-list .message .loading-indicator {
    display: none;
    gap: 0.8rem;
    width: 100%;
    flex-direction: column;
}
.chat-list .message.loading .loading-indicator {
    display: flex;
}
.chat-list .message .loading-indicator .loading-bar {
    height: 11px;
    width: 100%;
    border-radius: 0.135rem;
    background-position: -800px 0;
    background: linear-gradient(
        to right,
        #4285f4,
        var(--mirrored-primary-color),
        #4285f4
    );
    animation: loading 3s linear infinite;
}
.chat-list .message .loading-indicator .loading-bar:last-child {
    width: 70%;
}
@keyframes loading {
    0% {
        background-position: -800px 0;
    }
    100% {
        background-position: 800px 0;
    }
}
.typing-area {
    position: fixed;
    width: 100%;
    left: 0;
    bottom: 0;
    padding: 0.5rem;
    background: var(--mirrored-primary-color);
    z-index: 50; /* Ensure it is above the chat content */
}

/* We style the user's footer inside the typing area */
.typing-area .centered-chat-footer {
    position: static;
    text-align: center;
    transform: none;
    padding: 0;
    margin-top: 50px; /* Space from the disclaimer */
    color: var(--mirrored-placeholder-color);
    background: transparent;
}
.typing-area .centered-chat-footer a {
    color: var(--mirrored-placeholder-color);
}


.typing-area :where(.typing-form, .action-buttons) {
    display: flex;
    gap: 1.75rem;
}
.typing-form .input-wrapper {
    width: 100%;
    height: 56px;
    display: flex;
    position: relative;
}
.typing-form .typing-input {
    height: 100%;
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 1rem;
    color: var(--mirrored-text-color);
    padding: 1.1rem 4rem 1.1rem 1.5rem;
    border-radius: 100px;
    background: var(--mirrored-secondary-color);
}
.typing-form .typing-input:focus {
    background: var(--mirrored-secondary-hover-color);
}
.typing-form .typing-input::placeholder {
    color: var(--mirrored-placeholder-color);
}
.typing-area .icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    font-size: 1.4rem;
    color: var(--mirrored-text-color);
    align-items: center;
    justify-content: center;
    background: var(--mirrored-secondary-color);
    transition: 0.2s ease;
}
.typing-area .icon:hover {
    background: var(--mirrored-secondary-hover-color);
}
.typing-form #send-message-button {
    position: absolute;
    right: 0;
    outline: none;
    border: none;
    transform: scale(0);
    background: transparent;
    transition: transform 0.2s ease;
}
.typing-form .typing-input:valid ~ #send-message-button {
    transform: scale(1);
}
.typing-area .disclaimer-text {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 1rem;
    color: var(--mirrored-placeholder-color);
}
/* Responsive media query code for small screen */
@media (max-width: 768px) {
    .header :is(.title, .subtitle) {
        font-size: 2rem;
        line-height: 2.6rem;
    }
    .header .subtitle {
        font-size: 1.7rem;
    }
    .typing-area :where(.typing-form, .action-buttons) {
        gap: 0.4rem;
    }
    .typing-form .input-wrapper {
        height: 50px;
    }
    .typing-form .typing-input {
        padding: 1.1rem 3.5rem 1.1rem 1.2rem;
    }
    .typing-area .icon {
        height: 50px;
        width: 50px;
    }
    .typing-area .disclaimer-text {
        font-size: 0.75rem;
        margin-top: 0.5rem;
    }
}