:root {
    /* Define base light mode variables */
    --bg-primary: #ffffff;
    --bg-secondary: #f4f6fc;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --accent: #5e17eb;
    /* Vibrant purple */
    --accent-hover: #480ccb;
    --card-bg: rgba(255, 255, 255, 0.7);
    --border-color: rgba(0, 0, 0, 0.08);
    --btn-text: #ffffff;

    /* Variables for the dark portfolio section (always dark) */
    --dark-bg: #0a0a0f;
    --dark-text: #f4f4f4;
    --dark-card: rgba(20, 20, 30, 0.6);
    --dark-border: rgba(255, 255, 255, 0.1);

    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacings */
    --container-padding: 2rem;
    --section-spacing: 6rem;
}

[data-theme="dark"] {
    /* Override for dark mode on the whole site */
    --bg-primary: #0a0a0f;
    --bg-secondary: #14141e;
    --text-primary: #f8f9fa;
    --text-secondary: #a0a0B0;
    --accent: #8b44ff;
    /* Brighter purple for dark mode */
    --accent-hover: #7332e6;
    --card-bg: rgba(30, 30, 45, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --btn-text: #ffffff;
}

/* Base Reset & Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

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

/* --- Typography --- */
.text-gradient {
    background: linear-gradient(135deg, var(--accent), #f35588);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    font-family: var(--font-heading);
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn--primary {
    background-color: var(--accent);
    color: var(--btn-text);
    box-shadow: 0 4px 14px rgba(94, 23, 235, 0.3);
}

.btn--primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(94, 23, 235, 0.4);
}

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

.btn--outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(var(--bg-primary-rgb), 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

/* Need to define RGB variables for backdrop filter to work correctly on background */
:root {
    --bg-primary-rgb: 255, 255, 255;
}

[data-theme="dark"] {
    --bg-primary-rgb: 10, 10, 15;
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
}

.logo__icon {
    font-size: 1.8rem;
}

.nav__list {
    display: flex;
    gap: 2rem;
}

.nav__link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav__link:hover {
    color: var(--accent);
}

.header__actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
}

/* --- Niches / Experts Section --- */
.niches__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.niche-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-align: center;
}

.niche-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.niche-card__icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.niche-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.niche-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Featured Niche Card */
.niche-card--featured {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.niche-card__image-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.niche-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.5s ease;
}

.niche-card:hover .niche-card__image {
    transform: scale(1.05);
}

.niche-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.niche-card:hover .niche-card__overlay {
    opacity: 1;
}

.niche-card__content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.niche-card--featured .niche-card__icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.niche-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* --- Utilities --- */
.text-center {
    text-align: center;
}

.section {
    padding: var(--section-spacing) 0;
    scroll-margin-top: 80px;
}

.bg-secondary {
    background-color: var(--bg-secondary);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(var(--bg-primary-rgb), 0.5);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(5px);
    color: var(--text-primary);
}

/* --- Footer --- */
.footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding-bottom: calc(2rem + 60px);
    /* Space for chat widget on mobile */
}

/* --- Hero Section --- */
.hero {
    padding: calc(80px + 4rem) 0 4rem;
    /* Offset for fixed header */
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Base background gradient for Hero (Light Mode) */
.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(94, 23, 235, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

[data-theme="dark"] .hero::before {
    background: radial-gradient(circle, rgba(139, 68, 255, 0.2) 0%, rgba(10, 10, 15, 0) 70%);
}

.hero__container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero__title {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.hero__subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.hero__actions {
    display: flex;
    gap: 1rem;
}

.hero__visual {
    position: relative;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

.abstract-shape {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--accent), #f35588);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morph 8s ease-in-out infinite, float 6s ease-in-out infinite;
    box-shadow: 0 20px 50px rgba(94, 23, 235, 0.4);
    position: relative;
}

.abstract-shape::after {
    content: '';
    position: absolute;
    inset: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: inherit;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-theme="dark"] .abstract-shape::after {
    background: rgba(0, 0, 0, 0.2);
}

@keyframes morph {
    0% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }

    50% {
        border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
    }

    100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(10deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

/* --- Benefits Section --- */
.benefits__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.benefit-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .benefit-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.benefit-card__icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.benefit-card__title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.benefit-card__text {
    color: var(--text-secondary);
}

/* Center the 4th card (AI) on desktop (3-column grid) */
.benefits__grid .benefit-card:nth-child(4) {
    grid-column: 2;
}

/* --- Portfolio Section (Hybrid Dark) --- */
.portfolio {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

.portfolio .section-title,
.portfolio .section-subtitle {
    color: var(--dark-text);
}

.portfolio__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Center the 4th portfolio item on desktop */
.portfolio__grid .portfolio-item:nth-child(4) {
    grid-column: 2;
}

.portfolio-item {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-10px);
}

.portfolio-item__image {
    height: 200px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* Portfolio Mockup Scroll Effect */
.portfolio-item.hover-scroll {
    text-decoration: none;
    color: inherit;
    display: block;
}

.mockup-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 8s ease-in-out;
    transform: translateY(0);
}

.portfolio-item.hover-scroll:hover .mockup-img {
    transform: translateY(calc(-100% + 200px));
}

.portfolio-item__content {
    padding: 2rem;
}

.portfolio-item__content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.portfolio-item__content p {
    color: #a0a0B0;
}

/* --- Portfolio Offer Banner --- */
.portfolio__offer-banner {
    margin-top: 4rem;
    padding: 3rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.portfolio__offer-banner h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #ffffff, #a8a8a8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.portfolio__offer-banner p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-inline: auto;
    color: rgba(255, 255, 255, 0.8);
}

.portfolio__offer-banner strong {
    color: #38ef7d;
}

/* --- Upsell Section --- */
.upsell__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.upsell-card {
    background: var(--bg-primary);
    padding: 3rem;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.upsell-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

.upsell-card__badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, var(--accent), #f35588);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 10px rgba(94, 23, 235, 0.3);
}

.upsell-card__icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.upsell-card__title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.upsell-card__text {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
    flex-grow: 1;
}

.upsell-card__price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.btn--upsell {
    width: 100%;
}

[data-theme="dark"] .upsell-card {
    background: var(--card-bg);
}

/* --- Pricing Section --- */
.pricing__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    align-items: center;
}

.pricing-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .pricing-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.pricing-card--featured {
    border: 2px solid var(--accent);
    padding: 4rem 2rem;
    transform: scale(1.05);
    background: var(--bg-primary);
    /* Less transparent for featured */
}

.pricing-card--featured:hover {
    transform: scale(1.05) translateY(-5px);
}

.pricing-card__badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent), #f35588);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
}

.pricing-card__title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.pricing-card__price {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    margin-bottom: 2rem;
}

.pricing-card__features {
    text-align: left;
    margin-bottom: 2rem;
}

.pricing-card__features li {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn--full {
    width: 100%;
}

/* --- Order Form Section --- */
.order__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 4rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.order__benefits {
    margin-top: 2rem;
}

.order__benefits li {
    margin-bottom: 1rem;
    font-weight: 500;
}

.order__form {
    background: var(--bg-primary);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .order__form {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(94, 23, 235, 0.1);
}

[data-theme="dark"] .form-control:focus {
    box-shadow: 0 0 0 3px rgba(139, 68, 255, 0.2);
}

.form-error {
    color: #ff4d4f;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: none;
}

.form-error.active {
    display: block;
}

.form-success {
    background: rgba(56, 239, 125, 0.1);
    border: 1px solid #38ef7d;
    color: #11998e;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    text-align: center;
    font-weight: 600;
    display: none;
}

.form-success.active {
    display: block;
}

[data-theme="dark"] .form-success {
    color: #38ef7d;
}

/* --- Order Alternative Contact --- */
.order__alternative {
    margin-top: 2rem;
    text-align: center;
    border-top: 1px dashed var(--border-color);
    padding-top: 2rem;
}

.order__alternative p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.btn--telegram {
    border-color: #2AABEE;
    color: #2AABEE;
}

.btn--telegram:hover {
    background-color: #2AABEE;
    color: #fff;
    border-color: #2AABEE;
    box-shadow: 0 4px 14px rgba(42, 171, 238, 0.3);
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .hero__container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero__actions {
        justify-content: center;
    }

    .hero__subtitle {
        margin: 0 auto 2.5rem;
    }

    .hero__title {
        font-size: 3rem;
    }

    .hero__visual {
        height: 400px;
    }

    .portfolio__grid,
    .pricing__grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }

    .benefits__grid,
    .niches__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .benefits__grid .benefit-card:nth-child(4),
    .portfolio__grid .portfolio-item:nth-child(4) {
        grid-column: auto;
    }

    .upsell__grid {
        grid-template-columns: 1fr;
    }

    .pricing-card--featured {
        transform: scale(1);
        padding: 3rem 2rem;
    }

    .pricing-card--featured:hover {
        transform: translateY(-5px);
    }

    .order__inner {
        grid-template-columns: 1fr;
        padding: 2rem;
    }

    .order__form {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .header__actions {
        gap: 0.5rem;
    }

    .header__actions .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .benefits__grid,
    .niches__grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .header__container {
        padding: 0 1rem;
    }

    .logo__text {
        font-size: 1rem;
    }

    .logo__icon {
        font-size: 1.2rem;
    }

    .header__actions .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }

    .hero__title {
        font-size: 2.5rem;
    }

    .hero__subtitle {
        font-size: 1rem;
    }
}

/* =========================================
   AI Chat Widget Styles
   ========================================= */
.chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    font-family: inherit;
}

.chat-widget__toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #f35588);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(94, 23, 235, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    position: relative;
}

.chat-widget__toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(94, 23, 235, 0.6);
}

.chat-widget__tooltip {
    position: absolute;
    right: 100%;
    margin-right: 15px;
    background: var(--dark-bg);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.chat-widget__toggle:hover .chat-widget__tooltip {
    opacity: 1;
    transform: translateX(0);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform-origin: bottom right;
    transform: scale(0.8);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.chat-window.is-open {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.chat-window__header {
    background: linear-gradient(135deg, var(--accent), #f35588);
    color: white;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-window__header h4 {
    margin-bottom: 0.25rem;
    font-size: 1.125rem;
}

.chat-window__header p {
    font-size: 0.75rem;
    opacity: 0.9;
    margin: 0;
}

.chat-window__close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.chat-window__close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.chat-window__messages {
    height: 350px;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f8f9fa;
}

.chat-message {
    max-width: 85%;
    padding: 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

.chat-message--bot {
    background: white;
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chat-message--user {
    background: linear-gradient(135deg, var(--accent), #f35588);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 10px rgba(94, 23, 235, 0.2);
}

.chat-window__input-area {
    padding: 1rem;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 0.5rem;
}

.chat-window__input-area input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.chat-window__input-area input:focus {
    border-color: var(--accent);
}

.chat-message--typing {
    display: flex;
    gap: 4px;
    padding: 1rem 1.5rem;
    align-items: center;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: #a0a0B0;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* --- Dark Mode Chat Overrides --- */
[data-theme="dark"] .chat-window {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .chat-window__messages {
    background: var(--bg-secondary);
}

[data-theme="dark"] .chat-message--bot {
    background: var(--card-bg);
    color: var(--text-primary);
}

[data-theme="dark"] .chat-window__input-area {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .chat-window__input-area input {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .chat-widget {
        bottom: 1rem;
        right: 1rem;
    }

    .chat-window {
        position: fixed;
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        transform-origin: bottom center;
        border: none;
    }

    .chat-window__messages {
        flex: 1;
        height: auto;
    }
}