/* ==================================== */
/* 0. Core Variables and Base Styles */
/* ==================================== */
:root {
    /* Color Variables */
    --purple: #662D91;
    --lavender: #8BA8D2;
    --purple-dark: #4a1d68;
    --lavender-light: #b8cce8;
    --purple-light: #D1C4E9;
    --lavender-deep: #9575CD;

    /* Theme Variables */
    --bg: #ffffff;
    --text: #2D1E45; /* Deep purple for text */
    --card: #f8f5ff; /* Very light purple */
    --border-light: #ece0f7; /* Lighter border for cards */

    /* Gradients */
    --header-gradient: linear-gradient(to right, var(--purple), var(--lavender));
    --hero-gradient: linear-gradient(135deg, var(--purple-dark) 0%, var(--purple) 100%);
    --cta-gradient: linear-gradient(45deg, var(--lavender-deep) 0%, var(--lavender) 100%);
    --button-gradient: linear-gradient(to right, var(--purple), var(--lavender-deep));

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 5rem;

    /* Typography */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";

    /* Border Radius */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-circle: 50%;

    /* Shadows */
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.15);
    --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.06);

    /* Transitions */
    --transition-fast: all 0.2s ease-in-out;
    --transition-medium: all 0.3s ease-in-out;
}

/* Dark theme */
[data-theme='dark'] {
    --bg: #2a1a3a; /* Darker purple-ish background */
    --text: #e4e4e4; /* Light text for contrast */
    --card: #41364d; /* Slightly lighter dark card */
    --border-light: #5a4b6c;

    --header-gradient: linear-gradient(to right, var(--purple-dark), var(--lavender));
    --hero-gradient: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
    --cta-gradient: linear-gradient(45deg, var(--lavender) 0%, var(--lavender-deep) 100%);
    --button-gradient: linear-gradient(to right, var(--lavender-deep), var(--purple));
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text);
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

a {
    text-decoration: none;
    color: var(--lavender-deep);
    transition: var(--transition-fast);
}

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

.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 50px; /* Pill shape */
    font-weight: 600;
    text-align: center;
    transition: var(--transition-medium);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

/* ==================================== */
/* 1. Landing Page Main Layout */
/* ==================================== */
.landing-page-main {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--header-height, 60px) - var(--footer-height, 100px)); /* Adjust for actual header/footer height */
    overflow: hidden; /* For pseudo-elements */
}

.section-title {
    font-size: 3em;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-xl);
    position: relative;
    padding-bottom: var(--spacing-sm);
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--lavender-deep);
    border-radius: 2px;
}

/* ==================================== */
/* 2. Hero Section */
/* ==================================== */
.hero-section {
    background: var(--hero-gradient);
    color: var(--card); /* Light color for text on dark background */
    padding: var(--spacing-xxl) var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xl);
    min-height: 70vh;
    position: relative;
    overflow: hidden;
    isolation: isolate; /* For stacking context */
    text-align: left;
}

.hero-section::before,
.hero-section::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-circle);
    filter: blur(80px); /* Soft blur effect */
    z-index: -1;
}

.hero-section::before {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation: floatShape 15s ease-in-out infinite alternate;
}

.hero-section::after {
    width: 400px;
    height: 400px;
    bottom: -150px;
    right: -150px;
    animation: floatShape 20s ease-in-out infinite alternate-reverse;
}

@keyframes floatShape {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, 30px) scale(1.05); }
    100% { transform: translate(0, 0) scale(1); }
}

.hero-content {
    flex: 1;
    max-width: 700px;
    z-index: 1;
}

.hero-title {
    font-size: 4.5em;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--bg); /* White on hero background */
    text-shadow: var(--shadow-sm);
}

.hero-subtitle {
    font-size: 1.8em;
    font-weight: 600;
    color: var(--purple-light); /* Lighter purple for subtitle */
    margin-bottom: var(--spacing-sm);
}

.hero-description {
    font-size: 1.15em;
    color: var(--lavender-light); /* Even lighter for description */
    margin-bottom: var(--spacing-lg);
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.btn-primary-hero {
    background: var(--bg); /* White button */
    color: var(--purple);
    padding: 1rem 2.5rem;
    font-size: 1.1em;
    box-shadow: var(--shadow-md);
}

.btn-primary-hero:hover {
    background-color: var(--lavender-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary-hero {
    background: transparent;
    border: 2px solid var(--bg);
    color: var(--bg);
    padding: 1rem 2.5rem;
    font-size: 1.1em;
}

.btn-secondary-hero:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.welcome-message {
    font-size: 1.2em;
    color: var(--bg);
    font-weight: 600;
    margin-right: var(--spacing-md);
    display: flex;
    align-items: center;
}

.hero-visual {
    flex: 0.8;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.hero-visual img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    animation: fadeInSlide 1.2s ease-out forwards;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* ==================================== */
/* 3. Features Section */
/* ==================================== */
.features-section {
    background-color: var(--bg);
    padding: var(--spacing-xxl) var(--spacing-lg);
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-xl);
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background-color: var(--card);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-medium);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden; /* For hover effect */
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--button-gradient); /* Top border accent */
    transform: translateY(-100%);
    transition: var(--transition-medium);
}

.feature-card:hover::before {
    transform: translateY(0);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--purple-light);
    border-radius: var(--border-radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.feature-icon svg {
    width: 32px;
    height: 32px;
    color: var(--purple); /* Icon color */
}

.feature-card h3 {
    font-size: 1.7em;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text);
}

.feature-card p {
    font-size: 1.05em;
    color: var(--text);
    opacity: 0.8;
}

/* ==================================== */
/* 4. Call to Action Section */
/* ==================================== */
.cta-section {
    background: var(--cta-gradient);
    color: var(--card);
    padding: var(--spacing-xxl) var(--spacing-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.cta-section::before { /* Subtle background pattern */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.2;
    z-index: -1;
}

.cta-content {
    max-width: 900px;
    margin: 0 auto;
    z-index: 1;
}

.cta-title {
    color: var(--bg); /* White on dark CTA background */
    font-size: 3.5em;
    text-shadow: var(--shadow-sm);
}

.cta-description {
    font-size: 1.3em;
    margin-bottom: var(--spacing-xl);
    opacity: 0.9;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.btn-primary-cta {
    background: var(--bg); /* White button */
    color: var(--lavender-deep);
    padding: 1.2rem 3rem;
    font-size: 1.3em;
    box-shadow: var(--shadow-md);
}

.btn-primary-cta:hover {
    background-color: var(--purple-light);
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* ==================================== */
/* 5. Responsiveness */
/* ==================================== */
@media (max-width: 992px) {
    .hero-section {
        flex-direction: column-reverse; /* Image above content */
        text-align: center;
        padding-top: var(--spacing-xl);
        padding-bottom: var(--spacing-xl);
    }

    .hero-content {
        max-width: 100%;
        margin-top: var(--spacing-lg);
    }

    .hero-visual {
        max-width: 80%;
        margin-bottom: var(--spacing-lg);
    }

    .hero-actions {
        justify-content: center; /* Center buttons */
    }

    .hero-title {
        font-size: 3.5em;
    }

    .hero-subtitle {
        font-size: 1.5em;
    }

    .section-title {
        font-size: 2.5em;
    }

    .features-grid {
        grid-template-columns: 1fr; /* Stack features */
        max-width: 500px; /* Limit width of stacked cards */
    }

    .cta-title {
        font-size: 2.8em;
    }

    .cta-description {
        font-size: 1.1em;
    }
}

@media (max-width: 768px) {
    .hero-section {
        min-height: unset; /* Allow content to dictate height (Firefox compatible) */
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .hero-title {
        font-size: 2.8em;
    }

    .hero-subtitle {
        font-size: 1.2em;
    }

    .hero-description {
        font-size: 1em;
    }

    .btn-primary-hero, .btn-secondary-hero {
        padding: 0.8rem 1.8rem;
        font-size: 1em;
    }

    .section-title {
        font-size: 2em;
    }

    .features-section, .cta-section {
        padding: var(--spacing-xl) var(--spacing-md);
    }

    .feature-card h3 {
        font-size: 1.5em;
    }

    .cta-title {
        font-size: 2.2em;
    }

    .cta-description {
        font-size: 1em;
    }

    .btn-primary-cta {
        padding: 1rem 2.5rem;
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.2em;
    }

    .hero-actions {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .btn-primary-hero, .btn-secondary-hero {
        width: 100%;
        padding: 0.9rem 1.5rem;
    }

    .section-title {
        font-size: 1.8em;
        margin-bottom: var(--spacing-lg);
    }

    .feature-card h3 {
        font-size: 1.3em;
    }

    .feature-card p {
        font-size: 0.95em;
    }

    .cta-title {
        font-size: 1.8em;
    }

    .btn-primary-cta {
        padding: 0.9rem 2rem;
        font-size: 1em;
    }
}

/* Ensure these are present in your base.html or style.css, as the landing_page.css depends on them */
/*
:root {
    --header-height: 60px; // Example value, adjust as per your actual header
    --footer-height: 100px; // Example value, adjust as per your actual footer
}
*/