/* ============================================================
   AI Lab — Blog Shared Styles
   Shared nav, footer, register popup, lead form across all blog pages.
   Loaded AFTER each page's inline <style> so these rules win.
   ============================================================ */

:root {
    --primary: #6C3CE1;
    --primary-light: #8B5CF6;
    --primary-dark: #5228CC;
    --accent: #00D4AA;
    --accent-light: #34EABB;
    --dark: #1a1a2e;
    --dark-card: #25253e;
    --dark-lighter: #32324e;
    --text: #f0eef5;
    --text-muted: #b8b0d0;
    --gold: #F5C842;
    --orange: #FF7849;
    --border: rgba(255,255,255,0.08);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-pill: 9999px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.15);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.25);
    --shadow-brand: 0 8px 24px rgba(108,60,225,0.35);
}

/* ========== NAV (overrides any old inline nav css) ========== */
nav#navbar {
    position: fixed;
    top: 0; right: 0; left: 0;
    z-index: 100;
    height: 72px;
    padding: 0 2.5rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    background: rgba(15, 15, 30, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: background 0.3s, box-shadow 0.3s, border-color 0.3s;
    direction: ltr;
}

nav#navbar.scrolled {
    background: rgba(15, 15, 30, 0.92);
    border-bottom-color: var(--border);
}

nav#navbar .nav-logo {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--accent), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    justify-self: start;
}

nav#navbar .nav-links {
    display: flex;
    flex-direction: row;
    gap: 1.6rem;
    list-style: none;
    direction: ltr;
    align-items: center;
    margin: 0;
    padding: 0;
    justify-content: center;
}

nav#navbar .nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    direction: rtl;
    white-space: nowrap;
    unicode-bidi: plaintext;
    position: relative;
    padding-bottom: 2px;
}

nav#navbar .nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

nav#navbar .nav-links a:hover { color: var(--accent); }
nav#navbar .nav-links a:hover::after { width: 100%; }
nav#navbar .nav-links a.active { color: var(--accent); }
nav#navbar .nav-links a.active::after { width: 100%; }

nav#navbar .nav-cta-group {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    justify-content: flex-end;
}

nav#navbar .nav-cta {
    color: #fff !important;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-pill);
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s !important;
    white-space: nowrap;
    text-decoration: none !important;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    border: none;
}

nav#navbar .nav-cta::after { display: none !important; }

nav#navbar .nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    z-index: 300;
    width: 44px; height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    justify-self: end;
}

/* Mobile menu panel */
.mobile-menu-panel {
    display: none;
    position: fixed;
    top: 0; right: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: var(--dark);
    z-index: 250;
    flex-direction: column;
    padding: 1.5rem;
    border-left: 1px solid rgba(255,255,255,0.08);
    overflow-y: auto;
}

.mobile-menu-panel.open {
    display: flex;
    animation: menuSlideIn 0.3s ease;
}

@keyframes menuSlideIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.mobile-menu-logo {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mobile-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.mobile-menu-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
}

.mobile-menu-links li a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: background 0.2s;
}

.mobile-menu-links li a:hover { background: var(--dark-card); }

.mobile-menu-links .menu-icon { display: inline-block; font-size: 1.2rem; }

.mobile-menu-links .mobile-cta a {
    justify-content: center;
    font-weight: 600;
    margin-top: 0.5rem;
}

.mobile-menu-links .mobile-cta-green a {
    background: linear-gradient(135deg, var(--accent), #00b894);
    color: #fff;
    justify-content: center;
    font-weight: 700;
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Nav responsive — hamburger ≤1024px */
@media (max-width: 1024px) {
    nav#navbar .nav-links-desktop { display: none !important; }
    nav#navbar .nav-cta-group { display: none !important; }
    nav#navbar {
        display: flex;
        justify-content: space-between;
    }
    .mobile-menu-btn { display: flex; }
}

/* ========== REGISTER POPUP ========== */
.scroll-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.scroll-popup-overlay.popup-visible { display: flex; }

.scroll-popup-box {
    background: var(--dark-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 36px 32px 32px;
    width: 100%;
    max-width: 480px;
    position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6);
    animation: popupIn .3s ease;
    direction: rtl;
    text-align: right;
}

@keyframes popupIn {
    from { opacity: 0; transform: translateY(24px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.scroll-popup-close {
    position: absolute;
    top: 14px;
    left: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color .2s, background .2s;
}

.scroll-popup-close:hover { color: #fff; background: rgba(255,255,255,0.08); }

.scroll-popup-header { text-align: center; margin-bottom: 20px; }
.scroll-popup-icon { font-size: 2.2rem; margin-bottom: 8px; }
.scroll-popup-header h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; color: var(--text); }
.scroll-popup-header p { color: var(--text-muted); font-size: 0.9rem; }

@media (max-width: 480px) {
    .scroll-popup-box { padding: 28px 20px 24px; }
    .scroll-popup-header h3 { font-size: 1.2rem; }
}

/* ========== LEAD FORM (also used in popup) ========== */
.lead-form-section {
    max-width: 750px;
    margin: 0 auto 3rem;
    padding: 0 2rem;
}

.lead-form-card {
    background: linear-gradient(135deg, rgba(108,60,225,0.12), rgba(0,212,170,0.08));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    padding: 2.5rem;
    direction: rtl;
    text-align: right;
}

.lead-form-card h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text);
    text-align: center;
}

.lead-form-card .lead-form-sub {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.contact-form .form-group { margin-bottom: 1.1rem; }

.contact-form .form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.contact-form .form-group input,
.contact-form .form-group textarea {
    width: 100%;
    padding: 0.85rem 1.1rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    font-family: 'Heebo', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
    direction: rtl;
}

.contact-form .form-group input::placeholder,
.contact-form .form-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.contact-form .form-group input:focus,
.contact-form .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(108,60,225,0.15);
}

.contact-form .form-buttons {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.3rem;
}

.contact-form .form-buttons .btn-primary,
.contact-form .form-buttons .btn-whatsapp {
    flex: 1;
    justify-content: center;
    font-size: 0.95rem;
    padding: 0.85rem 1.4rem;
    border: none;
    cursor: pointer;
    font-family: 'Heebo', sans-serif;
    border-radius: var(--radius-pill);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: #fff;
}

.contact-form .form-buttons .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.contact-form .form-buttons .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-brand);
}

.contact-form .form-buttons .btn-whatsapp {
    background: #25D366;
}

.contact-form .form-buttons .btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37,211,102,0.4);
}

.lead-form-phone {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1rem;
}

.lead-form-phone a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

@media (max-width: 768px) {
    .lead-form-card { padding: 1.8rem 1.3rem; }
    .lead-form-section { padding: 0 1.2rem; }
    .contact-form .form-buttons { flex-direction: column; }
}

/* ========== FOOTER ========== */
footer.shared-footer {
    background: rgba(0,0,0,0.4);
    padding: 3rem 2rem 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    direction: rtl;
    border-top: 1px solid rgba(255,255,255,0.06);
}

footer.shared-footer .footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: right;
}

footer.shared-footer .footer-section h4 {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

footer.shared-footer .footer-section p,
footer.shared-footer .footer-section a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 2;
    transition: color 0.2s;
}

footer.shared-footer .footer-section a:hover { color: var(--accent); }

footer.shared-footer .footer-social {
    max-width: 1100px;
    margin: 1.5rem auto 0;
    display: flex;
    justify-content: center;
    gap: 1.2rem;
}

footer.shared-footer .footer-social a {
    color: var(--text-muted);
    transition: color 0.3s, transform 0.3s;
    display: flex;
}

footer.shared-footer .footer-social a:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

footer.shared-footer .footer-bottom {
    max-width: 1100px;
    margin: 1.5rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    footer.shared-footer .footer-content { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    footer.shared-footer .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    footer.shared-footer .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}
