/* ===== CHATIFIX - Professional Styles ===== */

:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --gradient-start: #0f172a;
    --gradient-end: #1e293b;
    --radius: 12px;
}

* { box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1e293b;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ===== Navbar ===== */
.navbar { padding: 1rem 0; transition: all 0.3s ease; z-index: 1050; }
.navbar.scrolled { background: rgba(255,255,255,0.98) !important; box-shadow: 0 2px 20px rgba(0,0,0,0.1); }
.navbar.scrolled .nav-link { color: #1e293b !important; }
.navbar.scrolled .navbar-brand { color: #1e293b !important; }
.navbar-brand { font-size: 1.4rem; }
.nav-link { font-weight: 500; transition: color 0.2s; white-space: nowrap; }
.nav-link:hover { color: var(--primary) !important; }
.navbar-nav { flex-wrap: nowrap; }

/* Navbar: compact on smaller desktops */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .navbar .nav-link { font-size: 0.82rem; padding-left: 0.4rem !important; padding-right: 0.4rem !important; }
    .navbar .btn-sm { font-size: 0.75rem; padding: 0.25rem 0.5rem; }
}
@media (min-width: 1200px) {
    .navbar .nav-link { font-size: 0.9rem; }
}

/* Mobile navbar: solid background when menu is open */
@media (max-width: 991.98px) {
    .navbar .navbar-collapse {
        background: #fff;
        border-radius: 0.75rem;
        padding: 1rem;
        margin-top: 0.5rem;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }
    .navbar .navbar-collapse .nav-link { color: #1e293b !important; white-space: normal; }
    .navbar .navbar-collapse .d-flex { margin-top: 0.5rem; flex-wrap: wrap; }
}

/* ===== Hero Section ===== */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, var(--gradient-start) 0%, #1a1a2e 50%, var(--primary-dark) 100%);
    overflow: hidden;
    padding-top: 80px;
}
.hero-bg {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 70% 50%, rgba(79,70,229,0.15) 0%, transparent 50%),
                radial-gradient(circle at 30% 80%, rgba(99,102,241,0.1) 0%, transparent 40%);
}
.text-gradient {
    background: linear-gradient(135deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero Demo Card */
.hero-demo-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}
.demo-header {
    background: #1e293b;
    padding: 12px 16px;
    display: flex;
    align-items: center;
}
.demo-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.demo-dot.red { background: #ef4444; }
.demo-dot.yellow { background: #f59e0b; }
.demo-dot.green { background: #22c55e; }
.demo-body { padding: 20px; }
.demo-body pre { color: #e2e8f0; font-size: 0.85rem; line-height: 1.6; }

/* ===== Page Header ===== */
.page-header {
    padding: 140px 0 60px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

/* ===== Spacing ===== */
.py-6 { padding-top: 5rem; padding-bottom: 5rem; }
.mb-6 { margin-bottom: 5rem; }
.mt-6 { margin-top: 5rem; }

/* ===== Step Cards ===== */
.step-card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
}
.step-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0,0,0,0.08); }
.step-number {
    position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--primary); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
}

/* ===== Feature Grid ===== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.feature-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    transition: all 0.3s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.08); border-color: var(--primary); }

/* ===== Feature Detail Cards ===== */
.feature-detail-card {
    padding: 32px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    height: 100%;
    transition: all 0.3s;
}
.feature-detail-card:hover { transform: translateY(-4px); box-shadow: 0 15px 35px rgba(0,0,0,0.08); }
.feature-icon-box {
    width: 60px; height: 60px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}

/* ===== Integration Cards ===== */
.integration-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}
.integration-card:hover { border-color: var(--primary); box-shadow: 0 8px 25px rgba(0,0,0,0.06); }

/* ===== Pricing Cards ===== */
.pricing-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 40px 32px;
    height: 100%;
    position: relative;
    transition: all 0.3s;
}
.pricing-card:hover { box-shadow: 0 20px 50px rgba(0,0,0,0.1); }
.pricing-card.popular {
    border: 2px solid var(--primary);
    box-shadow: 0 20px 50px rgba(79,70,229,0.15);
    transform: scale(1.02);
}
.popular-badge {
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: white;
    padding: 4px 20px; border-radius: 20px;
    font-size: 0.8rem; font-weight: 600;
}
.pricing-amount { display: flex; align-items: baseline; gap: 2px; margin: 16px 0; }
.pricing-amount .currency { font-size: 1.5rem; font-weight: 600; }
.pricing-amount .amount { font-size: 3.5rem; font-weight: 800; line-height: 1; }
.pricing-amount .period { font-size: 1rem; color: #94a3b8; }
.pricing-features { list-style: none; padding: 0; margin-bottom: 32px; }
.pricing-features li { padding: 8px 0; font-size: 0.95rem; }

/* Billing Toggle */
.billing-toggle-wrapper { position: relative; display: inline-block; }
.billing-toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.billing-toggle-track {
    display: inline-block; width: 56px; height: 30px;
    background: #e2e8f0; border-radius: 15px; cursor: pointer;
    position: relative; transition: background 0.3s;
}
.billing-toggle-thumb {
    position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
    background: #fff; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}
.billing-toggle-input:checked + .billing-toggle-track { background: var(--primary); }
.billing-toggle-input:checked + .billing-toggle-track .billing-toggle-thumb { transform: translateX(26px); }
.billing-label { font-size: 1rem; transition: opacity 0.3s; }
.yearly-savings-info { margin-top: 4px; }

/* ===== Trust Bar ===== */
.trust-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}
.trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
}
@media (max-width: 768px) {
    .trust-bar { gap: 20px; }
    .trust-item { font-size: 0.9rem; }
}

/* ===== Capability Cards ===== */
.capability-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    height: 100%;
    transition: all 0.3s;
}
.capability-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.08); border-color: var(--primary); }
.capability-icon {
    width: 64px; height: 64px;
    border-radius: 16px;
    display: inline-flex; align-items: center; justify-content: center;
}

/* ===== CTA Section ===== */
.cta-section {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--primary-dark) 100%);
}

/* ===== Footer ===== */
.footer-section { background: #f8fafc; border-top: 1px solid #e2e8f0; }

/* ===== Code Block ===== */
.code-block {
    background: #0f172a;
    color: #e2e8f0;
    padding: 24px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    line-height: 1.7;
    overflow-x: auto;
}

/* ===== API Docs ===== */
.api-nav .nav-link { color: #64748b; padding: 6px 12px; border-radius: 6px; font-size: 0.9rem; }
.api-nav .nav-link:hover { background: #eef2ff; color: var(--primary); }
.api-tabs .nav-pills .nav-link { font-size: 0.85rem; }
.api-tabs .nav-pills .nav-link.active { background: var(--primary); }

/* ===== Contact ===== */
.contact-icon {
    width: 48px; height: 48px; min-width: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}

/* ===== Demo Chat ===== */
.demo-chat-container {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    background: #fff;
}
.demo-chat-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 16px 20px;
    color: white;
}
.demo-chat-messages {
    height: 450px;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
}
.demo-chat-input {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

/* ===== Chat Messages ===== */
.chat-msg { margin-bottom: 16px; display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.bot { justify-content: flex-start; }
.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}
.chat-msg.user .chat-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}
.chat-msg.bot .chat-bubble {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

/* Chat Sources */
.chat-sources { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.source-tag {
    background: #eef2ff;
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Typing Indicator */
.chat-bubble.typing { display: flex; gap: 4px; padding: 16px 20px; }
.chat-bubble.typing span {
    width: 8px; height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}
.chat-bubble.typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-bubble.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* ===== Chat Widget (Floating) ===== */
.chat-widget { position: fixed; bottom: 24px; right: 24px; z-index: 9999; }
.chat-toggle-btn {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.4rem;
    box-shadow: 0 8px 25px rgba(79,70,229,0.4);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}
.chat-toggle-btn:hover { transform: scale(1.1); }
.chat-badge {
    position: absolute; top: -4px; right: -4px;
    background: #ef4444; color: white;
    width: 22px; height: 22px;
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex; align-items: center; justify-content: center;
}
.chat-window {
    position: absolute; bottom: 75px; right: 0;
    width: 380px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    background: #fff;
}
.chat-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.chat-avatar {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white;
}
.chat-messages {
    height: 350px;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
}
.chat-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e2e8f0;
}

/* ===== Blog Content ===== */
.blog-content h3 { font-size: 1.3rem; font-weight: 700; margin-top: 1.5rem; margin-bottom: 0.75rem; }
.blog-content p { color: #64748b; line-height: 1.8; margin-bottom: 1rem; }
.blog-content ul { color: #64748b; padding-left: 1.5rem; margin-bottom: 1rem; }
.blog-content li { margin-bottom: 0.5rem; line-height: 1.7; }
.blog-content a { color: var(--primary); text-decoration: underline; }

/* ===== Responsive ===== */

/* Large tablets */
@media (max-width: 991.98px) {
    .page-header { padding: 120px 0 40px; }
    .page-header h1 { font-size: 1.8rem; }
    .display-5 { font-size: 1.8rem; }
    .display-6 { font-size: 1.5rem; }
    .py-6 { padding-top: 3.5rem; padding-bottom: 3.5rem; }
}

/* Tablets and phones */
@media (max-width: 768px) {
    .hero-section { padding-top: 100px; }
    .hero-section h1 { font-size: 2rem; }
    .hero-section .lead { font-size: 1rem; }
    .hero-section .d-flex.gap-4 { gap: 1rem !important; }
    .hero-section .fs-3 { font-size: 1.3rem !important; }

    .page-header { padding: 110px 0 30px; }
    .page-header h1 { font-size: 1.6rem; }
    .page-header p { font-size: 0.9rem; }

    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .pricing-card { padding: 24px 20px; }
    .pricing-card.popular { transform: none; }
    .pricing-amount .amount { font-size: 2.5rem; }

    .capability-card { padding: 20px 14px; }
    .capability-card h5 { font-size: 1rem; }

    .step-card { padding: 2rem 1rem; }

    .chat-window { width: 320px; right: -10px; }
    .chat-widget { bottom: 16px; right: 16px; }

    .cta-section h2 { font-size: 1.6rem; }
    .cta-section .lead { font-size: 0.95rem; }

    .trust-bar { gap: 12px; }
    .trust-item { font-size: 0.85rem; gap: 6px; }
    .trust-item .fs-4 { font-size: 1.1rem !important; }

    .footer-section .row { gap: 0; }
    .footer-section h6 { margin-top: 0.5rem; }

    .blog-content h3 { font-size: 1.15rem; }
    .blog-content p, .blog-content li { font-size: 0.9rem; }
}

/* Small phones */
@media (max-width: 480px) {
    .hero-section h1 { font-size: 1.6rem; }
    .hero-section .d-flex.gap-3 { flex-direction: column; }
    .hero-section .btn-lg { width: 100%; }

    .page-header h1 { font-size: 1.4rem; }
    .display-5, .display-6 { font-size: 1.3rem; }

    .feature-grid { grid-template-columns: 1fr; }
    .pricing-amount .amount { font-size: 2rem; }

    .chat-window { width: 290px; right: -16px; }
    .chat-toggle-btn { width: 52px; height: 52px; font-size: 1.2rem; }

    .cta-section .d-flex { flex-direction: column; }
    .cta-section .btn-lg { width: 100%; }

    .demo-chat-messages { height: 350px; }

    .contact-icon { width: 40px; height: 40px; min-width: 40px; font-size: 1rem; }
}
