/* ══════════════════════════════════════════════════════
   Astler Engineering - Main Styles (v3.1)
   ══════════════════════════════════════════════════════ */

html, body {
    scroll-behavior: smooth;
}

body { 
    font-family: 'Inter', sans-serif; 
}

/* ── Navigation & Active States ────────────────────────── */
.nav-link.active, .nav-link.text-astler-primary {
    color: #2563EB !important;
    font-weight: 500 !important;
}

a, button {
    transition: all 0.2s ease;
}

/* ── Auth State Visibility (ULTRA-STRICT) ───────────────── */
/* 1. Reset all visibility to Hidden */
#guest-links, #auth-links, .astler-guest-only, .astler-auth-only { 
    display: none !important; 
}

/* 2. Show Guest Content only if Logged-in state is NOT active */
body.astler-guest .astler-guest-only,
#astler-header-actions.astler-guest .astler-guest-only {
    display: flex !important;
}

/* Desktop Guest Links */
@media (min-width: 768px) {
    body.astler-guest #guest-links,
    #astler-header-actions.astler-guest #guest-links {
        display: flex !important;
    }
}

/* 3. Show Auth Content only if Logged-in state IS active */
body.astler-logged-in .astler-auth-only,
#astler-header-actions.astler-logged-in .astler-auth-only {
    display: flex !important;
}

/* Desktop Auth Links */
@media (min-width: 768px) {
    body.astler-logged-in #auth-links,
    #astler-header-actions.astler-logged-in #auth-links {
        display: flex !important;
    }
}

/* ── Mobile Side Drawer ─────────────────────────────────── */
#mobile-menu-overlay {
    position: fixed;
    top: 73px;
    left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(3px);
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#mobile-menu {
    position: fixed;
    top: 73px; bottom: 0;
    width: 85%;
    max-width: 340px;
    background-color: #ffffff;
    z-index: 9998;
    overflow-y: auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.drawer-ltr { left: 0; transform: translateX(-100%); border-right: 1px solid #E2E8F0; }
.drawer-rtl { right: 0; transform: translateX(100%); border-left: 1px solid #E2E8F0; }

body.drawer-open .drawer-ltr,
body.drawer-open .drawer-rtl { transform: translateX(0); }
body.drawer-open #mobile-menu-overlay { opacity: 1; visibility: visible; }
body.drawer-open { overflow: hidden; }

@media (min-width: 768px) {
    #mobile-menu, #mobile-menu-overlay { display: none !important; }
}

/* ── UI Components (Slider & Marquee) ───────────────────── */
.hero-slider { position: absolute; inset: 0; z-index: 0; }
.slider-item { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 2s ease-in-out; }
.slider-item.active { opacity: 1; }

@keyframes marquee {
    0% { transform: translate3d(100vw, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}
.marquee-wrapper {
    animation: marquee 180s linear infinite;
    will-change: transform;
    display: flex;
}
.marquee-viewport:hover .marquee-wrapper {
    animation-play-state: paused;
}

/* ── Swup Transitions ──────────────────────────────────── */
.transition-fade {
    transition: 0.4s;
    opacity: 1;
}

html.is-animating .transition-fade {
    opacity: 0;
    transform: translateY(10px);
}

/* ── Authentication State Helpers ──────────────────────── */
.astler-logged-in .astler-guest-only,
.astler-guest .astler-logged-only {
    display: none !important;
}

.astler-logged-in .astler-logged-only {
    display: flex !important;
}

.astler-guest .astler-guest-only {
    display: flex !important;
}

/* ── Fixes & Utilities ─────────────────────────────────── */
.admin-bar nav { top: 32px !important; }
@media screen and (max-width: 782px) { .admin-bar nav { top: 46px !important; } }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

@media (max-width: 768px) {
    body { font-size: 14px; }
}