/* ─── CSS Variables ─── */
:root {
    --primary:       #0088cc;
    --primary-dark:  #006699;
    --primary-light: #33aadd;
    --primary-glow:  rgba(0, 136, 204, 0.25);
    --gradient:      linear-gradient(135deg, #0088cc 0%, #006699 100%);
    --gradient-soft: linear-gradient(135deg, rgba(0,136,204,.12) 0%, rgba(0,102,153,.08) 100%);

    --bg-body:   #f0f4f8;
    --bg-card:   #ffffff;
    --bg-nav:    rgba(255,255,255,0.85);
    --text-main: #1a2332;
    --text-mute: #5a6a7a;
    --border:    rgba(0,136,204,0.15);
    --shadow:    0 8px 32px rgba(0,136,204,0.12);
    --shadow-lg: 0 20px 60px rgba(0,136,204,0.18);
}

[data-bs-theme="dark"] {
    --bg-body:   #0d1117;
    --bg-card:   #161b22;
    --bg-nav:    rgba(13,17,23,0.90);
    --text-main: #e6edf3;
    --text-mute: #8b949e;
    --border:    rgba(0,136,204,0.20);
    --shadow:    0 8px 32px rgba(0,0,0,0.40);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.55);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    transition: background .3s, color .3s;
    overflow-x: hidden;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ─── Navbar ─── */
.navbar {
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: .9rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background .3s, box-shadow .3s;
}

.navbar.scrolled { box-shadow: var(--shadow); }

.navbar-brand {
    font-weight: 800;
    font-size: 1.4rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.navbar-brand .brand-icon {
    width: 36px; height: 36px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    -webkit-text-fill-color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.nav-link {
    color: var(--text-mute) !important;
    font-weight: 500;
    padding: .4rem .9rem !important;
    border-radius: 8px;
    transition: color .2s, background .2s;
    font-size: .92rem;
}

.nav-link:hover {
    color: var(--primary) !important;
    background: var(--gradient-soft);
}

.btn-nav-cta {
    background: var(--gradient);
    color: #fff !important;
    border-radius: 10px;
    padding: .45rem 1.2rem !important;
    font-weight: 600;
    box-shadow: 0 4px 14px var(--primary-glow);
    transition: transform .2s, box-shadow .2s;
}

.btn-nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

/* Theme toggle */
.theme-toggle {
    width: 40px; height: 40px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    transition: all .2s;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: rotate(20deg);
}

/* Hamburger */
.navbar-toggler {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: .4rem .6rem;
    background: var(--bg-card);
    color: var(--text-main);
}

.navbar-toggler:focus { box-shadow: none; }
.navbar-toggler-icon {
    background-image: none;
    display: flex; flex-direction: column;
    gap: 5px; width: 22px;
}

.navbar-toggler-icon span {
    display: block; height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: all .3s;
}

.navbar-collapse {
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
}

@media (max-width: 991px) {
    .navbar-collapse {
        border-top: 1px solid var(--border);
        padding: 1rem 0;
        margin-top: .5rem;
    }
}

/* ─── Hero ─── */
.hero {
    min-height: 92vh;
    display: flex; align-items: center;
    position: relative;
    overflow: hidden;
    padding: 5rem 0 4rem;
}

.hero-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 20% 40%, rgba(0,136,204,.10) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 80% 70%, rgba(0,102,153,.08) 0%, transparent 55%);
    pointer-events: none;
}

.hero-bg::after {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(circle, rgba(0,136,204,.08) 1px, transparent 1px);
    background-size: 32px 32px;
}

.hero-badge {
    display: inline-flex; align-items: center; gap: .5rem;
    background: var(--gradient-soft);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: .4rem 1rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1.5rem;
    animation: fadeDown .6s ease both;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 1.2rem;
    animation: fadeUp .7s .1s ease both;
}

.hero-title .highlight {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-mute);
    line-height: 1.8;
    margin-bottom: 2rem;
    max-width: 520px;
    animation: fadeUp .7s .2s ease both;
}

.hero-actions {
    display: flex; gap: 1rem; flex-wrap: wrap;
    animation: fadeUp .7s .3s ease both;
}

.btn-primary-custom {
    background: var(--gradient);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: .85rem 2rem;
    font-weight: 700;
    font-size: 1rem;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 20px var(--primary-glow);
    transition: transform .2s, box-shadow .2s;
    position: relative;
    overflow: hidden;
}

.btn-primary-custom::after {
    content: '';
    position: absolute; inset: 0;
    background: rgba(255,255,255,0);
    transition: background .2s;
}

.btn-primary-custom:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px var(--primary-glow);
}

.btn-primary-custom:active::after { background: rgba(255,255,255,.15); }

.btn-outline-custom {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: .85rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    transition: all .2s;
}

.btn-outline-custom:hover {
    background: var(--gradient);
    color: #fff;
    transform: translateY(-3px);
}

/* Hero visual */
.hero-visual {
    animation: fadeUp .8s .2s ease both;
    position: relative;
    overflow: hidden;
}

.hero-phone-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.8rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: floatY 4s ease-in-out infinite;
}

.hero-phone-card::before {
    content: '';
    position: absolute; inset: -1px;
    border-radius: 25px;
    background: var(--gradient);
    z-index: -1;
    opacity: .3;
    filter: blur(12px);
}

.chat-bubble {
    background: var(--gradient-soft);
    border: 1px solid var(--border);
    border-radius: 16px 16px 4px 16px;
    padding: .7rem 1rem;
    margin-bottom: .8rem;
    font-size: .88rem;
    color: var(--text-main);
    animation: slideInRight .5s ease both;
}

.chat-bubble.sent {
    background: var(--gradient);
    color: #fff;
    border-radius: 16px 16px 16px 4px;
    border: none;
    margin-right: 1.5rem;
}

.chat-bubble.received { margin-left: 1.5rem; }

.chat-bubble:nth-child(1) { animation-delay: .8s; }
.chat-bubble:nth-child(2) { animation-delay: 1.1s; }
.chat-bubble:nth-child(3) { animation-delay: 1.4s; }

.typing-indicator {
    display: flex; gap: 4px; align-items: center;
    padding: .5rem .8rem;
    background: var(--gradient-soft);
    border-radius: 12px;
    width: fit-content;
    margin-top: .5rem;
}

.typing-dot {
    width: 7px; height: 7px;
    background: var(--primary);
    border-radius: 50%;
    animation: typingBounce 1.2s ease-in-out infinite;
}

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

/* Floating badges */
.float-badge {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .5rem .9rem;
    font-size: .8rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    display: flex; align-items: center; gap: .4rem;
    white-space: nowrap;
}

.float-badge.top-right {
    top: -0.5rem;
    left: 0;
    animation: floatY 3s 1s ease-in-out infinite;
}

.float-badge.bottom-left {
    bottom: -0.5rem;
    right: 0;
    animation: floatY 3.5s .5s ease-in-out infinite;
}

/* ─── Stats ─── */
.stats-section {
    padding: 4rem 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
}

.stat-number {
    font-size: 2.6rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: .3rem;
}

.stat-label {
    color: var(--text-mute);
    font-size: .9rem;
    font-weight: 500;
}

/* ─── Section ─── */
.section { padding: 5rem 0; }

.section-badge {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--gradient-soft);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: .35rem .9rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 800;
    margin-bottom: .8rem;
}

.section-desc {
    color: var(--text-mute);
    font-size: 1rem;
    line-height: 1.8;
    max-width: 560px;
    margin: 0 auto;
}

/* ─── Feature Cards ─── */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    height: 100%;
    transition: transform .3s, box-shadow .3s, border-color .3s;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    background: var(--gradient);
    border-radius: 0 20px 0 80px;
    opacity: .06;
    transition: opacity .3s;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.feature-card:hover::before { opacity: .12; }

.feature-icon {
    width: 52px; height: 52px;
    background: var(--gradient);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 1.2rem;
    box-shadow: 0 6px 16px var(--primary-glow);
}

.feature-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: .6rem;
}

.feature-desc {
    color: var(--text-mute);
    font-size: .9rem;
    line-height: 1.7;
}

/* ─── API Section ─── */
.api-section {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.code-block {
    background: #0d1117;
    border: 1px solid rgba(0,136,204,.2);
    border-radius: 16px;
    padding: 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: .85rem;
    line-height: 1.7;
    overflow-x: auto;
    position: relative;
}

.code-block .line-method { color: #79c0ff; }
.code-block .line-url    { color: #a5d6ff; }
.code-block .line-key    { color: #7ee787; }
.code-block .line-val    { color: #ffa657; }
.code-block .line-str    { color: #a5d6ff; }
.code-block .line-comment{ color: #8b949e; }

.copy-btn {
    position: absolute;
    top: .8rem; left: .8rem;
    background: rgba(0,136,204,.15);
    border: 1px solid rgba(0,136,204,.3);
    border-radius: 8px;
    color: var(--primary-light);
    padding: .3rem .7rem;
    font-size: .75rem;
    cursor: pointer;
    transition: all .2s;
}

.copy-btn:hover { background: rgba(0,136,204,.3); }

.endpoint-badge {
    display: inline-block;
    background: var(--gradient);
    color: #fff;
    border-radius: 6px;
    padding: .2rem .6rem;
    font-size: .75rem;
    font-weight: 700;
    font-family: monospace;
    margin-left: .5rem;
}

/* ─── Pricing ─── */
.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    height: 100%;
    transition: transform .3s, box-shadow .3s;
    position: relative;
    overflow: hidden;
}

.pricing-card.featured {
    background: var(--gradient);
    border-color: transparent;
    color: #fff;
}

.pricing-card.featured .text-muted-custom { color: rgba(255,255,255,.75); }

.pricing-card:not(.featured):hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

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

.pricing-badge {
    position: absolute;
    top: 1.2rem; left: 1.2rem;
    background: rgba(255,255,255,.2);
    border-radius: 50px;
    padding: .25rem .8rem;
    font-size: .75rem;
    font-weight: 700;
    color: #fff;
}

.pricing-price {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
}

.pricing-price span { font-size: 1rem; font-weight: 500; }

.pricing-feature {
    display: flex; align-items: center; gap: .6rem;
    padding: .5rem 0;
    font-size: .92rem;
    border-bottom: 1px solid var(--border);
}

.pricing-card.featured .pricing-feature { border-color: rgba(255,255,255,.15); }

.pricing-feature:last-of-type { border-bottom: none; }

.check-icon {
    width: 22px; height: 22px;
    background: rgba(0,136,204,.15);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    font-size: .7rem;
    flex-shrink: 0;
}

.pricing-card.featured .check-icon {
    background: rgba(255,255,255,.2);
    color: #fff;
}

/* ─── CTA ─── */
.cta-section {
    padding: 6rem 0;
    background: var(--gradient);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.cta-section .section-title { color: #fff; }
.cta-section .section-desc  { color: rgba(255,255,255,.8); }

.btn-cta-white {
    background: #fff;
    color: var(--primary);
    border: none;
    border-radius: 12px;
    padding: .9rem 2.2rem;
    font-weight: 700;
    font-size: 1rem;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    transition: transform .2s, box-shadow .2s;
}

.btn-cta-white:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(0,0,0,.25);
}

/* ─── Footer ─── */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
}

.footer-brand {
    font-size: 1.2rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-desc {
    color: var(--text-mute);
    font-size: .88rem;
    line-height: 1.7;
    margin-top: .5rem;
}

.footer-link {
    color: var(--text-mute);
    text-decoration: none;
    font-size: .88rem;
    display: block;
    padding: .25rem 0;
    transition: color .2s;
}

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

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    margin-top: 2rem;
    color: var(--text-mute);
    font-size: .82rem;
}

/* ─── Animations ─── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-12px); }
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30%            { transform: translateY(-6px); }
}

@keyframes pulse-ring {
    0%   { transform: scale(.9); opacity: .7; }
    100% { transform: scale(1.4); opacity: 0; }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Scroll-reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .6s ease, transform .6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }
.reveal-delay-4 { transition-delay: .4s; }

/* Ripple */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.35);
    transform: scale(0);
    animation: rippleAnim .5s linear;
    pointer-events: none;
}

@keyframes rippleAnim {
    to { transform: scale(4); opacity: 0; }
}

/* Pulse dot */
.pulse-dot {
    position: relative;
    display: inline-block;
    width: 10px; height: 10px;
    background: #00cc66;
    border-radius: 50%;
}

.pulse-dot::after {
    content: '';
    position: absolute; inset: -3px;
    border-radius: 50%;
    border: 2px solid #00cc66;
    animation: pulse-ring 1.5s ease-out infinite;
}

/* ─── Mobile ─── */
@media (max-width: 575px) {
    .float-badge { display: none; }
    .code-block { font-size: .75rem; padding: 1rem; }
    .hero-phone-card { padding: 1.2rem; }
    .hero-actions { flex-direction: column; }
    .hero-actions button { width: 100%; }
}

section, .hero, .stats-section, .api-section {
    max-width: 100vw;
    overflow-x: hidden;
}
