/* ============================================================
   Alpha Cleanic — Main Stylesheet
   Brand Palette:
     #69E9DC  — Mint Teal   (primary accent, CTA)
     #2C485A  — Steel Blue  (secondary, hover)
     #0D2132  — Deep Navy   (dark backgrounds)
     #000000  — Pure Black  (footer)
   ============================================================ */

:root {
    --brand-teal:  #69E9DC;
    --brand-mid:   #2C485A;
    --brand-dark:  #0D2132;
    --brand-black: #000000;
}

/* ── Brand utilities (CSS fallback for Tailwind CDN) ──────── */
.text-brand-teal        { color: var(--brand-teal)  !important; }
.text-brand-mid         { color: var(--brand-mid)   !important; }
.text-brand-dark        { color: var(--brand-dark)  !important; }
.bg-brand-teal          { background-color: var(--brand-teal)  !important; }
.bg-brand-mid           { background-color: var(--brand-mid)   !important; }
.bg-brand-dark          { background-color: var(--brand-dark)  !important; }
.bg-brand-black         { background-color: var(--brand-black) !important; }
.border-brand-teal      { border-color: var(--brand-teal) !important; }
.border-brand-mid       { border-color: var(--brand-mid)  !important; }
.border-brand-dark      { border-color: var(--brand-dark) !important; }

/* Teal opacity variants */
.bg-brand-teal\/10      { background-color: rgba(105,233,220,0.10) !important; }
.bg-brand-teal\/20      { background-color: rgba(105,233,220,0.20) !important; }
.bg-brand-teal\/30      { background-color: rgba(105,233,220,0.30) !important; }
.border-brand-teal\/20  { border-color: rgba(105,233,220,0.20) !important; }
.border-brand-teal\/30  { border-color: rgba(105,233,220,0.30) !important; }
.border-brand-dark\/50  { border-color: rgba(13,33,50,0.50) !important; }
.border-brand-mid\/50   { border-color: rgba(44,72,90,0.50) !important; }

/* Hover */
.hover\:bg-brand-teal:hover      { background-color: var(--brand-teal) !important; }
.hover\:bg-brand-mid:hover       { background-color: var(--brand-mid)  !important; }
.hover\:text-brand-teal:hover    { color: var(--brand-teal) !important; }
.hover\:bg-brand-teal\/20:hover { background-color: rgba(105,233,220,0.20) !important; }
.hover\:bg-brand-teal\/30:hover { background-color: rgba(105,233,220,0.30) !important; }

/* Focus ring */
.focus\:ring-brand-teal:focus {
    --tw-ring-color: var(--brand-teal);
    box-shadow: 0 0 0 2px rgba(105,233,220,0.5) !important;
}

/* Shadow */
.shadow-brand-teal\/20 { box-shadow: 0 10px 25px rgba(105,233,220,0.20) !important; }

/* Gradient */
.from-brand-teal { --tw-gradient-from: var(--brand-teal) var(--tw-gradient-from-position) !important; }
.to-brand-mid    { --tw-gradient-to:   var(--brand-mid)  var(--tw-gradient-to-position)   !important; }

/* Active sidebar tab */
.a-tab-btn.active { background-color: var(--brand-teal) !important; color: var(--brand-dark) !important; }

/* Scrollbar */
#admin-sidebar::-webkit-scrollbar-thumb { background: var(--brand-mid); border-radius: 4px; }

/* Base */
body {
    font-family: 'Inter', sans-serif;
    top: 0 !important;
    transition: all 0.3s ease;
}

/* ── SPA Page Routing ─────────────────────────────────────── */
.page         { display: none; }
.page.active  { display: block; animation: fadeIn 0.4s ease; }

.step-content        { display: none; }
.step-content.active { display: block; }

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

/* ── RTL Support ─────────────────────────────────────────── */
[dir="rtl"] .text-left  { text-align: right; }
[dir="rtl"] .text-right { text-align: left; }
[dir="rtl"] .rotate-rtl { transform: rotate(180deg); }

/* ── Modal ──────────────────────────────────────────────── */
body.modal-open { overflow: hidden; }

/* ── Admin Sidebar ──────────────────────────────────────── */
#admin-sidebar {
    transition: width 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: #334155 #0f172a;
}

#admin-sidebar::-webkit-scrollbar       { width: 4px; }
#admin-sidebar::-webkit-scrollbar-track { background: #0f172a; }
#admin-sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

@media (min-width: 768px) {
    .sidebar-collapsed                { width: 5rem !important; }
    .sidebar-collapsed span           { display: none; }
    .sidebar-collapsed .shrink-0      { margin: auto; }
}

/* ── Active sidebar tab ─────────────────────────────────── */
.a-tab-btn.active {
    background-color: #2563eb;
    color: #ffffff;
}

/* ── Cards hover effect ─────────────────────────────────── */
.card-hover {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

/* ── Gallery image ──────────────────────────────────────── */
.gallery-img {
    transition: transform 0.5s ease;
}
.gallery-img:hover { transform: scale(1.05); }

/* ── Promo banner ───────────────────────────────────────── */
#promo-banner-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 50;
}
@media (min-width: 768px) {
    #promo-banner-container {
        position: relative;
        bottom: auto;
    }
}

/* ── Custom scrollbar for main content ─────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Form focus ring ────────────────────────────────────── */
input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.3);
}

/* ── Loading spinner ────────────────────────────────────── */
.spinner {
    width: 20px; height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility ────────────────────────────────────────────── */
.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ============================================================
   MOBILE — PUBLIC SITE
   ============================================================ */

/* Push content above fixed bottom nav on mobile */
@media (max-width: 767px) {
    footer                { padding-bottom: 80px; }
    #promo-banner-container { bottom: 64px; }
    .hero-title           { font-size: 2.4rem !important; line-height: 1.15 !important; }
    #public-gallery       { grid-template-columns: 1fr !important; }
    .footer-grid          { grid-template-columns: 1fr !important; text-align: center !important; }
    .footer-grid ul li a  { justify-content: center !important; }
    .pricing-grid         { grid-template-columns: 1fr !important; }
    .pricing-grid .transform { transform: none !important; }
}

/* Mobile bottom nav */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--brand-dark);
    border-top: 1px solid rgba(105,233,220,0.15);
    justify-content: space-around;
    align-items: center;
    padding: 6px 4px 10px;
    z-index: 60;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
@media (max-width: 767px) {
    .mobile-nav { display: flex; }
}
.mobile-nav button,
.mobile-nav a {
    display: flex; flex-direction: column;
    align-items: center; gap: 2px;
    color: rgba(255,255,255,0.55);
    font-size: 10px; font-weight: 700;
    background: none; border: none; cursor: pointer;
    text-transform: uppercase; letter-spacing: 0.04em;
    padding: 4px 10px;
    transition: color 0.2s;
    text-decoration: none;
    min-width: 52px;
}
.mobile-nav button svg,
.mobile-nav a svg { width: 20px; height: 20px; }
.mobile-nav button.active,
.mobile-nav a.active { color: var(--brand-teal); }
.mobile-nav .nav-cta {
    background: var(--brand-teal);
    color: var(--brand-dark) !important;
    border-radius: 12px;
    padding: 6px 14px;
    margin-bottom: 2px;
}

/* ============================================================
   ADMIN PANEL — MOBILE
   ============================================================ */

/* ── Mobile top bar ─────────────────────────────────────────── */
#admin-topbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; height: 56px;
    background: var(--brand-dark);
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    z-index: 200;
    border-bottom: 1px solid rgba(105,233,220,0.15);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
@media (max-width: 767px) {
    #admin-topbar { display: flex; }
}

/* ── Sidebar overlay (mobile) ───────────────────────────────── */
#sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 150;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
#sidebar-overlay.show { display: block; }

/* ── Sidebar base ───────────────────────────────────────────── */
@media (max-width: 767px) {
    /* On mobile: sidebar is off-canvas */
    #admin-sidebar {
        position: fixed !important;
        top: 0; left: 0;
        height: 100vh;
        z-index: 180;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
        width: 260px !important;
        overflow-y: auto;
    }
    #admin-sidebar.is-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.4);
    }
    /* Main content: full width, no margin, top padding for top bar */
    #admin-main-content {
        margin-left: 0 !important;
        padding-top: 56px !important;
        width: 100%;
    }
    /* The wrapper must not be flex so sidebar doesn't push content */
    #adminWrap {
        display: block !important;
        height: 100vh;
        overflow: hidden;
    }
}

/* ── Desktop: collapsible sidebar ───────────────────────────── */
@media (min-width: 768px) {
    #admin-sidebar {
        position: relative;
        transform: none !important;
        height: 100vh;
        transition: width 0.28s ease;
        flex-shrink: 0;
    }
    #admin-sidebar.is-collapsed {
        width: 64px !important;
    }
    #admin-sidebar.is-collapsed .sidebar-label { display: none; }
    #admin-sidebar.is-collapsed .sidebar-brand-text { display: none; }
    #admin-sidebar.is-collapsed nav button,
    #admin-sidebar.is-collapsed .sidebar-bottom a,
    #admin-sidebar.is-collapsed .sidebar-bottom button {
        justify-content: center !important;
        padding: 12px 0 !important;
    }
    #admin-sidebar.is-collapsed .sidebar-brand {
        justify-content: center !important;
    }
    #admin-topbar { display: none !important; }
    #sidebar-overlay { display: none !important; }
}

/* ── Mobile tab pill bar ────────────────────────────────────── */
#admin-tab-bar {
    display: none;
}
@media (max-width: 767px) {
    #admin-tab-bar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding: 10px 14px;
        background: #fff;
        border-bottom: 1px solid #e2e8f0;
        position: sticky;
        top: 56px;
        z-index: 100;
        scrollbar-width: none;
        width: 100%;
        box-sizing: border-box;
    }
    #admin-tab-bar::-webkit-scrollbar { display: none; }
    #admin-tab-bar button {
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center;
        gap: 5px;
        flex-shrink: 0;
        padding: 7px 14px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 700;
        border: 1.5px solid #e2e8f0;
        background: #f8fafc;
        color: #64748b;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.18s;
    }
    #admin-tab-bar button.is-active {
        background: var(--brand-teal);
        color: var(--brand-dark);
        border-color: var(--brand-teal);
    }
    /* Main content scrollable area */
    #admin-main-content {
        height: calc(100vh - 56px - 48px); /* viewport - topbar - tabbar */
        overflow-y: auto;
        padding: 16px !important;
    }
}
