/* ============================================================
   KroLead — Reusable Components
   Navbar · Buttons · Section Layout · Footer · WhatsApp
   ============================================================ */

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all 0.3s var(--ease-out);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    line-height: 1;
}

.btn-sm { padding: 10px 20px; font-size: 14px; }
.btn-md { padding: 12px 28px; }
.btn-lg { padding: 16px 36px; font-size: 16px; }

.btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Primary */
.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 36px rgba(99, 102, 241, 0.45);
}

/* Secondary */
.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

/* White (for dark backgrounds) */
.btn-white {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.btn-white:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Full width */
.btn-full { width: 100%; }

/* ============================================================
   SECTION LAYOUT
   ============================================================ */
.section {
    padding: 120px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-tag {
    display: inline-block;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: var(--radius-full);
    margin-bottom: 20px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.section-desc {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .section {
        padding: 80px 0;
    }

    .section-header {
        margin-bottom: 40px;
    }

    .section-title {
        font-size: clamp(28px, 6vw, 42px);
    }

    .section-desc {
        font-size: 16px;
    }
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: all 0.4s var(--ease-out);
}

.navbar.scrolled {
    background: var(--navbar-bg);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    box-shadow: var(--shadow-xs);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1001;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
}

.logo-text {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: 4px 0;
    transition: color 0.3s;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 1px;
    transition: width 0.3s var(--ease-out);
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-cta {
    padding: 10px 24px;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: all 0.3s var(--ease-out);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.nav-cta:hover {
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

/* ---- Theme Toggle ---- */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    color: var(--text-secondary);
}

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

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ---- Language Switcher ---- */
.lang-switcher {
    position: relative;
}

.lang-switcher-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-body);
}

.lang-switcher-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    max-height: 340px;
    overflow-y: auto;
    background: var(--floating-card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 6px;
    z-index: 1001;
}

.lang-dropdown.open {
    display: block;
    animation: fadeInUp 0.2s var(--ease-out);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    text-align: left;
    color: var(--text-secondary);
    font-size: 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.lang-option:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.lang-option.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    font-weight: 600;
}

/* ---- Mobile Menu ---- */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all 0.3s var(--ease-out);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.footer-tagline {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-col a {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    padding: 4px 0;
    transition: color 0.3s;
}

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

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* Footer variant for secondary pages */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-links a {
    font-size: 14px;
    color: var(--text-muted);
    transition: color 0.3s;
}

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

/* ============================================================
   FLOATING WHATSAPP BUTTON
   ============================================================ */
.floating-whatsapp {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 18px 36px rgba(18, 140, 126, 0.28);
    transition: all 0.3s var(--ease-out);
    text-decoration: none;
}

.floating-whatsapp:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 48px rgba(18, 140, 126, 0.4);
}

.floating-whatsapp__icon {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.floating-whatsapp__icon svg {
    width: 18px;
    height: 18px;
}

.floating-whatsapp__text {
    line-height: 1;
}

/* ============================================================
   MOBILE STICKY CTA
   ============================================================ */
.mobile-sticky-cta {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    gap: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 8px 12px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.mobile-sticky-cta__link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 12px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
}

.mobile-sticky-cta__link--primary {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
}

.mobile-sticky-cta__link--secondary {
    background: transparent;
    color: var(--text-secondary);
}

/* ============================================================
   RTL SUPPORT
   ============================================================ */
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] .hero-text { text-align: right; }
[dir="rtl"] .hero-actions { flex-direction: row-reverse; }
[dir="rtl"] .callpilot-content { direction: rtl; }
[dir="rtl"] .offline-content { direction: rtl; }
[dir="rtl"] .cp-feature { flex-direction: row-reverse; }
[dir="rtl"] .offline-list li { flex-direction: row-reverse; }
[dir="rtl"] .footer-links-grid { direction: rtl; }

/* ============================================================
   RESPONSIVE — COMPONENTS
   ============================================================ */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        padding: 20px 24px;
        border-bottom: 1px solid var(--border);
        gap: 0;
        box-shadow: var(--shadow-lg);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 14px 0;
        width: 100%;
        font-size: 16px;
    }

    .nav-links a::after {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .nav-cta {
        display: none;
    }

    .lang-switcher-btn span:not(svg) {
        display: none;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-links-grid {
        grid-template-columns: 1fr;
    }

    .mobile-sticky-cta {
        display: flex;
    }

    .floating-whatsapp {
        bottom: 72px;
    }

    .floating-whatsapp__text {
        display: none;
    }
}

@media (max-width: 480px) {
    .lang-dropdown {
        right: -60px;
        width: 180px;
    }
}
