/* --- CSS Variables & Basic Reset --- */
:root {
    --primary-color: #007bff;
    --success-color: #28a745;
    --success-hover-color: #218838;
    /* A nice, trustworthy blue */
    --primary-hover-color: #0056b3;
    --secondary-color: #6c757d;
    /* A complementary grey */
    --secondary-hover-color: #545b62;
    --accent-color: #17a2b8;
    /* A techy teal/cyan for highlights */
    --highlight-color: var(--primary-color);
    /* For text highlights */

    --text-color: #212529;
    /* Dark grey for text */
    --text-light-color: #495057;
    --background-color: #ffffff;
    --card-background-color: #f8f9fa;
    --border-color: #dee2e6;
    --footer-bg-color: #343a40;
    --footer-text-color: #f8f9fa;

    --font-family: 'Poppins', sans-serif;
    --base-font-size: 16px;
    --line-height: 1.6;

    --container-width: 1140px;
    --border-radius: 8px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
    --transition-speed: 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #0d6efd;
        /* Slightly brighter blue for dark mode */
        --primary-hover-color: #0b5ed7;
        --secondary-color: #6c757d;
        --secondary-hover-color: #5c636a;
        --accent-color: #20c997;
        /* A vibrant teal for dark mode */
        --highlight-color: var(--accent-color);

        --text-color: #e9ecef;
        /* Light grey for text */
        --text-light-color: #adb5bd;
        --background-color: #000;
        /* Very dark grey, not pure black */
        --card-background-color: #1e1e1e;
        /* Darker card background */
        --border-color: #343a40;
        --footer-bg-color: #0c0c0c;
        --footer-text-color: #adb5bd;

        --box-shadow: 0 4px 15px rgba(255, 255, 255, 0.05);
    }
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--base-font-size);
    line-height: var(--line-height);
    color: var(--text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-bottom: 0.75em;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3rem);
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    text-align: center;
    margin-bottom: 1.5em;
}

h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
}

p {
    margin-bottom: 1em;
}

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

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

.highlight {
    color: var(--highlight-color);
    font-weight: 700;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.75em 0;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: background-color var(--transition-speed), color var(--transition-speed), border-color var(--transition-speed), transform 0.2s ease-out;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover-color);
    border-color: var(--primary-hover-color);
    color: #fff;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #fff;
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover-color);
    border-color: var(--secondary-hover-color);
    color: #fff;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-large {
    padding: 1em 0;
    font-size: 1.1rem;
}

/* --- Header --- */
header {
    background-color: var(--background-color);
    padding: 1em 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid var(--border-color);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo svg {
    width: 10rem;
    transform: translateY(4px);
    fill: var(--primary-color);
}

.logo:hover svg {
    fill: var(--primary-hover-color);
}

header nav ul {
    list-style: none;
    display: flex;
    align-items: center;
}

header nav ul li {
    margin-left: 20px;
}

header nav ul li a {
    font-weight: 600;
    color: var(--text-light-color);
    padding: 0.5em;
}

header nav ul li a:hover,
header nav ul li a.active {
    color: var(--primary-color);
}

header nav ul li a.btn {
    color: var(--primary-color);
    /* Initial color for outline button */
}

header nav ul li a.btn:hover {
    color: #fff;
    /* Color on hover for outline button */
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}


/* --- Sections --- */
.section-padding {
    padding: 60px 0;
}

.alt-bg {
    background-color: var(--card-background-color);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* --- Hero Section --- */
#hero {
    padding: 80px 0 0 0;
    text-align: center;
}

#hero h1 {
    margin-bottom: 0.5em;
}

#hero .subtitle {
    font-size: 1.2rem;
    color: var(--text-light-color);
    max-width: 700px;
    margin: 0 auto 1.5em auto;
}

#hero .btn-large {
    margin-bottom: 2em;
}

.hero-image-placeholder {
    margin-top: 40px;
    padding: 30px;
    background-color: var(--card-background-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: inline-block;
    opacity: 0.7;
}

.hero-image-placeholder i {
    color: var(--accent-color);
    margin-bottom: 10px;
}

/* --- How It Works Section --- */
.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    text-align: center;
}

.step-card {
    background-color: var(--background-color);
    /* Or var(--card-background-color) if preferred */
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
}

.step-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.step-card h3 {
    margin-bottom: 10px;
}

/* --- Features Section --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-item {
    background-color: var(--background-color);
    /* Or var(--card-background-color) if this section is not alt-bg */
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.feature-item i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    background-color: var(--primary-color);
    color: white;
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-item h3 {
    margin-bottom: 10px;
}

/* --- Use Cases Section --- */
.use-case-list {
    list-style: none;
    padding-left: 0;
    max-width: 800px;
    margin: 0 auto;
}

.use-case-list li {
    background-color: var(--card-background-color);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border-left: 5px solid var(--primary-color);
    display: flex;
    align-items: flex-start;
    /* Align icon and text to top */
}

.use-case-list li i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 15px;
    margin-top: 4px;
    /* Align icon nicely with first line of text */
}

.use-case-list li strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color);
}

/* --- Pricing Section --- */
.pricing-tiers {
    display: flex;
    justify-content: center;
    align-items: stretch;
    /* Makes cards same height */
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.pricing-tier {
    background-color: var(--background-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    text-align: center;
    position: relative;
    /* For popular badge */
}

.pricing-tier.popular {
    border-color: var(--primary-color);
    border-width: 2px;
    transform: scale(1.05);
    /* Slightly larger */
}

.popular-badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
}

.pricing-tier h3 {
    color: var(--primary-color);
}

.price-tag {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--text-color);
}

.pricing-tier ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
    text-align: left;
    flex-grow: 1;
    /* Pushes button to bottom */
}

.pricing-tier ul li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.pricing-tier ul li i {
    color: var(--accent-color);
    /* Green checkmark */
    margin-right: 10px;
}

.pricing-tier .btn {
    margin-top: auto;
    /* Pushes button to bottom */
    width: 100%;
}

.api-note {
    text-align: center;
    font-style: italic;
    color: var(--text-light-color);
    max-width: 600px;
    margin: 20px auto 0;
}

.chat-toggle-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    transition: var(--transition-speed);
    position: fixed;
    bottom: 15px;
    right: 20px;
}

.chat-toggle-button:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-2px);
}

.chat-toggle-button i {
    margin-right: 10px;
    font-size: 1.2em;
}

.chat-toggle-button-your {
    background-color: var(--success-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    transition: var(--transition-speed);
    position: fixed;
    bottom: 75px;
    right: 20px;
}

.chat-toggle-button-your:hover {
    background-color: var(--success-hover-color);
    transform: translateY(-2px);
}

.chat-toggle-button-your i {
    margin-right: 10px;
    font-size: 1.2em;
}

/* --- Footer --- */
footer {
    background-color: var(--footer-bg-color);
    color: var(--footer-text-color);
    padding: 40px 0;
    text-align: center;
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 0.5em;
    color: var(--footer-text-color);
    /* Explicitly set for p inside footer */
}

footer a {
    color: var(--accent-color);
}

footer a:hover {
    color: var(--primary-color);
}

/* .social-links {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}
.social-links li {
    display: inline-block;
    margin: 0 10px;
}
.social-links li a {
    font-size: 1.5rem;
} */


/* --- Responsive Design --- */
@media (max-width: 768px) {
    header .container {
        flex-wrap: wrap;
        /* Allow logo and toggle to be on one line, nav on next */
    }

    .menu-toggle {
        display: block;
        /* Show hamburger */
        order: 3;
        /* Push toggle to the right of logo */
        margin-left: auto;
    }

    header nav {
        width: 100%;
        order: 4;
        /* Nav below logo and toggle */
    }

    header nav ul {
        display: none;
        /* Hide nav links by default */
        flex-direction: column;
        width: 100%;
        background-color: var(--background-color);
        /* Give a background for mobile menu */
        position: absolute;
        top: 100%;
        /* Position below header */
        left: 0;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        border-top: 1px solid var(--border-color);
    }

    header nav ul.active {
        display: flex;
        /* Show when active */
    }

    header nav ul li {
        margin: 0;
        width: 100%;
        text-align: center;
    }

    header nav ul li a {
        padding: 1em;
        display: block;
        border-bottom: 1px solid var(--border-color);
    }

    header nav ul li:last-child a {
        border-bottom: none;
    }

    header nav ul li a.btn {
        margin: 10px auto;
        display: inline-block;
        /* Keep button styling */
        width: auto;
        /* Adjust width for button */
    }


    #hero h1 {
        font-size: 2rem;
    }

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

    .pricing-tiers {
        flex-direction: column;
        align-items: center;
    }

    .pricing-tier {
        width: 100%;
        max-width: 350px;
        /* Limit width on mobile */
        margin-bottom: 20px;
        /* Add margin for stacked cards */
    }

    .pricing-tier.popular {
        transform: scale(1);
        /* Reset scale for mobile stack */
    }

    .chat-toggle-button {
        /* Ensure button isn't huge on mobile */
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* --- Scroll Animations --- */
.scroll-animate {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
    /* Hint to browser for optimization */
}

/* Default: Fade in and slide up */
.scroll-animate.fade-in-up {
    transform: translateY(30px);
    /* Start 30px down */
}

.scroll-animate.fade-in-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Variation: Fade in from left */
.scroll-animate.fade-in-left {
    transform: translateX(-30px);
    /* Start 30px to the left */
}

.scroll-animate.fade-in-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Variation: Fade in from right */
.scroll-animate.fade-in-right {
    transform: translateX(30px);
    /* Start 30px to the right */
}

.scroll-animate.fade-in-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered animation for children of a container */
.stagger-children>.scroll-animate {
    transition-delay: 0s;
    /* Default, will be overridden by JS or more specific CSS if needed */
}

/* Example: Stagger children in a grid or flex container */
.stagger-children.is-visible>.scroll-animate:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger-children.is-visible>.scroll-animate:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger-children.is-visible>.scroll-animate:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger-children.is-visible>.scroll-animate:nth-child(4) {
    transition-delay: 0.4s;
}

/* Add more nth-child rules if you have more items */


/* Optional: Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {

    .scroll-animate,
    .scroll-animate.is-visible {
        transition-duration: 0.01ms !important;
        /* Effectively instant */
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        /* Play only once (very fast) */
        transition-delay: 0ms !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Ensure visibility from 360px */
@media (max-width: 380px) {
    .container {
        width: 95%;
        /* A bit more space for very small screens */
    }

    #hero h1 {
        font-size: 1.8rem;
    }

    #hero .subtitle {
        font-size: 1rem;
    }

    .btn {
        padding: 0.6em 0;
        font-size: 0.9rem;
    }

    .btn-large {
        padding: 0.8em 0;
        font-size: 1rem;
    }

    .chat-toggle-button {
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .chat-toggle-button i {
        margin-right: 5px;
    }
}

/* hero image */
.hero-image-container {
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    /* Center the image horizontally */
}

.hero-image-container div {
    width: 100%;
    max-width: 500px;
    background-image: url(light.jpg);
    background-size: contain;
    background-position: top center;
    background-repeat: no-repeat;
    height: 200px;
}

@media (prefers-color-scheme: dark) {
    .hero-image-container div {
        background-image: url(dark.jpg);
    }
}

/* --- File Upload Styles --- */
#upload-area {
    max-width: 600px;
    margin: 30px auto;
    padding: 40px;
    border: 2px dashed #007bff;
    border-radius: 10px;
    text-align: center;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

#upload-area:hover {
    background-color: #f0f8ff;
}

#upload-area.dragover {
    border-color: #28a745;
    background-color: #e9f5ec;
}

#upload-area p {
    margin: 0;
    font-size: 1.2em;
    color: #555;
}

#progress-container {
    display: none;
    max-width: 600px;
    margin: 30px auto;
    padding: 20px;
}

#progress-bar {
    width: 100%;
    height: 25px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
}

#progress-bar-fill {
    width: 0%;
    height: 100%;
    background-color: #28a745;
    text-align: center;
    color: white;
    line-height: 25px;
    font-weight: bold;
    transition: width 0.4s ease;
}

#status-message {
    text-align: center;
    margin-top: 10px;
    font-size: 1em;
    color: #333;
}

#post-upload-area {
    display: none;
    text-align: center;
    margin: 30px auto;
}

#post-upload-area button {
    padding: 12px 25px;
    font-size: 1em;
}

#error-message {
    color: #dc3545;
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
    display: none;
}

#chat-interface {
    display: none;
    margin-top: 2rem;
}

/* --- NEW: Dark Mode Styles --- */
@media (prefers-color-scheme: dark) {

    /* Define dark theme colors using CSS variables for consistency */
    :root {
        --dm-bg-primary: #121212;
        --dm-bg-secondary: #1e1e1e;
        --dm-text-primary: #e0e0e0;
        --dm-text-secondary: #b3b3b3;
        --dm-border-color: #444;
        --dm-accent-blue: #3a9cff;
        --dm-accent-red: #ff5c5c;
        --dm-accent-green: #28a745;
    }

    /* Override original site's main styles */
    body {
        background-color: var(--dm-bg-primary);
        color: var(--dm-text-primary);
    }

    .navbar,
    .footer {
        background-color: var(--dm-bg-secondary);
        border-bottom: 1px solid var(--dm-border-color);
    }

    .hero h1,
    .hero p,
    .logo {
        color: var(--dm-text-primary);
    }

    .nav-links a {
        color: var(--dm-text-secondary);
    }

    .nav-links a:hover {
        color: var(--dm-text-primary);
    }

    a {
        color: var(--dm-accent-blue);
    }

    /* Override our custom component styles */
    #upload-area {
        background-color: var(--dm-bg-secondary);
        border-color: var(--dm-accent-blue);
    }

    #upload-area p {
        color: var(--dm-text-primary);
    }

    #upload-area small {
        color: var(--dm-text-secondary);
    }

    #upload-area:hover {
        background-color: #2a2a2a;
    }

    #upload-area.dragover {
        background-color: #1a3d20;
        /* Darker green */
        border-color: var(--dm-accent-green);
    }

    #progress-bar {
        background-color: #333;
    }

    #status-message {
        color: var(--dm-text-secondary);
    }

    #error-message {
        color: var(--dm-accent-red);
    }

    /* Style the chat interface for dark mode */
    .chat-container {
        background-color: transparent;
    }

    .chat-window {
        background-color: var(--dm-bg-secondary);
        border: 1px solid var(--dm-border-color);
    }

    .message.received {
        background-color: #333;
    }

    .message.received p {
        color: var(--dm-text-primary);
    }

    .chat-input input[type="text"] {
        background-color: #333;
        color: var(--dm-text-primary);
        border: 1px solid var(--dm-border-color);
    }

    .chat-input input[type="text"]::placeholder {
        color: var(--dm-text-secondary);
    }
}