/*!
 * Family AI - Agent Zero Theme
 * Admin-style layout: fixed left sidebar with toggle (Joomla Atum-inspired)
 */

/* =========================================================
   CSS variables
   ========================================================= */
:root {
    --a0-bg:           #0a0a0f;
    --a0-bg-2:         #12121a;
    --a0-surface:      rgba(20, 20, 30, 0.85);
    --a0-surface-2:    rgba(30, 30, 45, 0.7);
    --a0-border:       rgba(139, 92, 246, 0.15);
    --a0-border-hi:    rgba(139, 92, 246, 0.45);
    --a0-text:         #e6e6f0;
    --a0-text-dim:     #9090a8;
    --a0-purple:       #8b5cf6;
    --a0-cyan:         #06b6d4;
    --a0-green:        #10b981;
    --a0-mono:         'SF Mono', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    --a0-sidebar-open:    240px;
    --a0-sidebar-closed:  68px;
    --a0-header-h:        72px;
    --a0-transition:      cubic-bezier(.4, 0, .2, 1) 280ms;
}

/* =========================================================
   Reset & base
   ========================================================= */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body.familyai-agentzero {
    background: var(--a0-bg);
    color: var(--a0-text);
    font-family: var(--a0-mono);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: var(--a0-cyan); text-decoration: none; transition: color 180ms ease; }
a:hover { color: var(--a0-purple); }

/* Animated grid background */
.grid-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridShift 40s linear infinite;
}
@keyframes gridShift {
    from { background-position: 0 0; }
    to   { background-position: 40px 40px; }
}

/* Terminal prompts/cursors */
.prompt {
    color: var(--a0-purple);
    font-weight: 700;
    margin-right: 8px;
}
.cursor {
    display: inline-block;
    color: var(--a0-cyan);
    animation: blink 1s step-end infinite;
    margin-left: 4px;
}
@keyframes blink {
    0%, 50%   { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* =========================================================
   Wrapper layout
   ========================================================= */
.a0-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

/* =========================================================
   Sidebar (fixed, left)
   ========================================================= */
.a0-sidebar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--a0-sidebar-open);
    background: linear-gradient(180deg, var(--a0-bg-2) 0%, var(--a0-bg) 100%);
    border-right: 1px solid var(--a0-border);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow: hidden;
    transition: width var(--a0-transition), transform var(--a0-transition);
}

.a0-wrapper.closed .a0-sidebar-wrapper {
    width: var(--a0-sidebar-closed);
}

.a0-sidebar-sticky {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
    display: flex;
    flex-direction: column;
}
.a0-sidebar-sticky::-webkit-scrollbar { width: 6px; }
.a0-sidebar-sticky::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
}

/* Brand mini */
.a0-sidebar-brand {
    height: var(--a0-header-h);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    border-bottom: 1px solid var(--a0-border);
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
}
.a0-brand-prompt {
    color: var(--a0-purple);
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}
.a0-brand-text {
    color: var(--a0-cyan);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
    transition: opacity 180ms ease;
}
.a0-wrapper.closed .a0-brand-text { opacity: 0; }

/* Toggle button row */
.a0-sidebar-toggle {
    border-bottom: 1px solid var(--a0-border);
    flex-shrink: 0;
}
.a0-sidebar-toggle a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: var(--a0-text-dim);
    transition: background 180ms ease, color 180ms ease;
    white-space: nowrap;
    overflow: hidden;
}
.a0-sidebar-toggle a:hover {
    background: rgba(139, 92, 246, 0.08);
    color: var(--a0-purple);
}

/* Hamburger / collapse icon (pure CSS) */
/* Hamburger / collapse icon: element = middle bar, ::before = top, ::after = bottom */
.a0-collapse-icon {
    display: inline-block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    position: relative;
    flex-shrink: 0;
    margin: 7px 0;
}
.a0-collapse-icon::before,
.a0-collapse-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 220ms ease, opacity 220ms ease;
}
.a0-collapse-icon::before { top: -6px; }
.a0-collapse-icon::after  { top: 6px; }
/* Closed state: top line rotates to arrow pointing right */
.a0-collapse-icon.is-closed::before { transform: translateY(3px) rotate(30deg) scaleX(0.7); }
.a0-collapse-icon.is-closed::after  { transform: translateY(-3px) rotate(-30deg) scaleX(0.7); }

.a0-sidebar-item-title {
    transition: opacity 180ms ease;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.a0-wrapper.closed .a0-sidebar-item-title { opacity: 0; }

/* Sidebar menu container */
.a0-sidebar-menu {
    flex: 1 1 auto;
    padding: 8px 0;
}

/* =========================================================
   Menu module styling (mod_a0menu items inside sidebar)
   ========================================================= */
.a0-menu-tree,
.a0-sidebar-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.a0-menu-item,
.a0-sidebar-menu li {
    margin: 0;
}
.a0-menu-link,
.a0-sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    color: var(--a0-text-dim);
    border-left: 2px solid transparent;
    transition: all 180ms ease;
    white-space: nowrap;
    overflow: hidden;
}
.a0-menu-link:hover,
.a0-sidebar-menu a:hover {
    background: rgba(139, 92, 246, 0.10);
    color: var(--a0-text);
    border-left-color: var(--a0-cyan);
}
.a0-menu-link.current,
.a0-menu-link.active,
.a0-sidebar-menu li.current > a,
.a0-sidebar-menu li.active  > a {
    background: rgba(139, 92, 246, 0.18);
    color: var(--a0-cyan);
    border-left-color: var(--a0-purple);
}
.a0-menu-icon {
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}
.a0-menu-text {
    transition: opacity 180ms ease;
}
.a0-wrapper.closed .a0-menu-text { opacity: 0; }
.a0-wrapper.closed .a0-menu-link {
    justify-content: center;
    padding: 10px 0;
    gap: 0;
    border-left: 2px solid transparent;
}
.a0-wrapper.closed .a0-menu-icon {
    width: auto;
    font-size: 18px;
    flex-shrink: 0;
}
.a0-wrapper.closed .a0-menu-text {
    display: none;
}
.a0-wrapper.closed .a0-menu-icon-img {
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0;
}

/* Children indentation */
.a0-menu-children .a0-menu-link {
    padding-left: 42px;
    font-size: 13px;
}
.a0-wrapper.closed .a0-menu-children {
    display: block;
}
.a0-wrapper.closed .a0-menu-children .a0-menu-link {
    padding-left: 10px;
}

/* =========================================================
   Main container (right of sidebar)
   ========================================================= */
.a0-container-main {
    margin-left: var(--a0-sidebar-open);
    min-height: 100vh;
    transition: margin-left var(--a0-transition);
    display: flex;
    flex-direction: column;
}
.a0-wrapper.closed .a0-container-main {
    margin-left: var(--a0-sidebar-closed);
}

/* Site header */
.a0-site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--a0-header-h);
    background: var(--a0-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--a0-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
}
.a0-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 24px;
}
.a0-logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.a0-site-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--a0-cyan);
    letter-spacing: 1px;
    text-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}
.a0-subheading {
    margin: 0 0 0 12px;
    color: var(--a0-purple);
    font-size: 13px;
    font-style: italic;
    opacity: 0.85;
}
.a0-tagline {
    margin: 0 0 0 12px;
    color: var(--a0-text-dim);
    font-size: 12px;
}

/* Main nav (top header modules) */
.a0-main-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}
.a0-main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}
.a0-main-nav a {
    padding: 8px 14px;
    border-radius: 4px;
    color: var(--a0-text);
    transition: all 180ms ease;
    font-size: 13px;
}
.a0-main-nav a:hover {
    background: rgba(139, 92, 246, 0.15);
    color: var(--a0-cyan);
}

/* Banner */
.a0-banner-area {
    position: relative;
    padding: 40px 24px;
    overflow: hidden;
    border-bottom: 1px solid var(--a0-border);
}
.glow-orb {
    position: absolute;
    top: 50%;
    right: 10%;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--a0-purple) 0%, transparent 70%);
    filter: blur(30px);
    opacity: 0.4;
    transform: translateY(-50%);
    animation: pulseOrb 4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes pulseOrb {
    0%, 100% { opacity: 0.3; transform: translateY(-50%) scale(1); }
    50%      { opacity: 0.55; transform: translateY(-50%) scale(1.1); }
}

/* Main content */
.a0-main-content {
    flex: 1 1 auto;
    padding: 32px;
    max-width: 100%;
}
.a0-main-content h1,
.a0-main-content h2,
.a0-main-content h3 {
    color: var(--a0-cyan);
    font-weight: 700;
    letter-spacing: 0.5px;
}
.a0-main-content article,
.a0-main-content .item-page {
    background: var(--a0-surface-2);
    border: 1px solid var(--a0-border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(8px);
}
.a0-main-content article:hover {
    border-color: var(--a0-border-hi);
}
/* Hide Joomla page heading in main content — menu already shows active page */
.a0-main-content .page-header {
    display: none;
}

/* Footer */
.a0-site-footer {
    border-top: 1px solid var(--a0-border);
    background: var(--a0-bg-2);
    padding: 20px 24px;
    color: var(--a0-text-dim);
    font-size: 12px;
}
.a0-site-footer .copyright {
    margin: 0;
    text-align: center;
}
.a0-site-footer .prompt {
    margin-right: 0;
    color: var(--a0-green);
}
.prompt-maintenance {
    color: #ef4444 !important; /* red — site under maintenance */
    animation: maintenance-pulse 1.5s ease-in-out infinite;
}
@keyframes maintenance-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

/* =========================================================
   Mobile burger button (only visible on small screens)
   ========================================================= */
.a0-toggler-burger {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    width: 44px;
    height: 44px;
    border: 1px solid var(--a0-border);
    background: var(--a0-surface);
    border-radius: 6px;
    cursor: pointer;
    color: var(--a0-cyan);
    align-items: center;
    justify-content: center;
}
.a0-burger-icon {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    position: relative;
}
.a0-burger-icon::before,
.a0-burger-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background: currentColor;
}
.a0-burger-icon::before { top: -7px; }
.a0-burger-icon::after  { top: 7px; }

/* Mobile overlay */
.a0-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--a0-transition);
}

/* =========================================================
   Responsive - Mobile-first improvements
   ========================================================= */

/* TABLETS & SMALL LAPTOPS (max-width: 768px) */
@media (max-width: 768px) {
    .a0-toggler-burger {
        display: flex;
        top: 8px;
        left: 8px;
        width: 48px;
        height: 48px;
        background: var(--a0-surface);
        border: 1px solid var(--a0-border-hi);
    }

    .a0-sidebar-wrapper {
        width: var(--a0-sidebar-open);
        transform: translateX(-100%);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.6);
    }
    .a0-wrapper.open .a0-sidebar-wrapper {
        transform: translateX(0);
    }

    .a0-container-main {
        margin-left: 0 !important;
        padding-top: 64px;
        width: 100vw;
        max-width: 100%;
        overflow-x: hidden;
    }

    .a0-wrapper.open .a0-mobile-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .a0-site-header {
        padding: 0 12px 0 56px;
        height: auto;
        min-height: var(--a0-header-h);
    }
    .a0-header-inner {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 0;
    }
    .a0-logo-area {
        flex-wrap: wrap;
        gap: 4px;
    }
    .a0-site-title {
        font-size: 18px;
        line-height: 1.2;
    }
    .a0-subheading {
        font-size: 12px;
        margin-left: 4px;
    }
    .a0-tagline {
        font-size: 11px;
        margin-left: 0;
        width: 100%;
    }

    .a0-main-nav {
        gap: 8px;
        flex-wrap: wrap;
    }
    .a0-main-nav a {
        padding: 6px 10px;
        font-size: 12px;
    }

    .a0-banner-area { padding: 24px 16px; }
    .glow-orb { width: 140px; height: 140px; opacity: 0.25; }

    .a0-main-content {
        padding: 16px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    .a0-main-content article,
    .a0-main-content .item-page {
        padding: 16px;
        border-radius: 6px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    .a0-main-content h1 { font-size: 20px; }
    .a0-main-content h2 { font-size: 17px; }
    .a0-main-content h3 { font-size: 15px; }

    .a0-site-footer { padding: 16px; font-size: 11px; }
}

/* PHONES (max-width: 480px) */
@media (max-width: 480px) {
    body.familyai-agentzero {
        font-size: 15px;
        line-height: 1.55;
    }

    .a0-toggler-burger {
        width: 44px;
        height: 44px;
        top: 6px;
        left: 6px;
    }

    .a0-container-main {
        padding-top: 56px;
    }

    .a0-site-header {
        padding: 0 10px 0 52px;
        min-height: 56px;
    }
    .a0-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 6px 0;
    }
    .a0-logo-area {
        width: 100%;
        justify-content: flex-start;
    }
    .a0-site-title {
        font-size: 16px;
    }
    .a0-subheading {
        font-size: 11px;
        margin-left: 0;
        display: block;
        width: 100%;
    }
    .a0-tagline {
        display: none;
    }

    .a0-main-nav {
        width: 100%;
        justify-content: flex-start;
    }
    .a0-main-nav ul {
        flex-wrap: wrap;
        gap: 4px;
    }
    .a0-main-nav a {
        padding: 5px 8px;
        font-size: 12px;
    }

    .a0-banner-area { padding: 16px 12px; }
    .glow-orb { width: 100px; height: 100px; }

    .a0-main-content {
        padding: 12px;
    }
    .a0-main-content article,
    .a0-main-content .item-page {
        padding: 12px;
    }
    .a0-main-content h1 { font-size: 18px; }
    .a0-main-content h2 { font-size: 15px; }
    .a0-main-content h3 { font-size: 14px; }
    .a0-main-content p {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Make all sidebar menu items larger for touch */
    .a0-menu-link,
    .a0-sidebar-menu a {
        padding: 14px 16px;
        font-size: 15px;
    }

    .a0-site-footer { padding: 12px; }
    .a0-site-footer .copyright { text-align: left; }
}

/* Extra large content safety: force-wrap long strings */
.a0-main-content pre,
.a0-main-content code,
.a0-main-content table,
.a0-main-content td,
.a0-main-content th {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Prevent Joomla default tables from breaking mobile */
.a0-main-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Touch-friendly links everywhere */
a, button {
    touch-action: manipulation;
}

/* Space Agent login link - top right header */
.a0-space-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #f3f7ff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 200ms ease;
    white-space: nowrap;
}
.a0-space-link:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(6, 182, 212, 0.25));
    border-color: rgba(139, 92, 246, 0.6);
    color: #7ddcff;
    box-shadow: 0 0 20px rgba(125, 220, 255, 0.15);
}

/* Conditional login/register link in header (shown to guests) */
.a0-login-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 7px 14px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #c4b5fd;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.a0-login-link:hover { opacity: 0.85; }

/* My Space link in sidebar for logged-in users */
.a0-space-wrap {
    margin-top: 16px;
    padding: 0 12px;
}
.a0-space-wrap .a0-space-link {
    display: flex;
    width: 100%;
    padding: 10px 16px;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.12));
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #7ddcff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 200ms ease;
    justify-content: center;
    text-align: center;
}
.a0-space-wrap .a0-space-link:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(6, 182, 212, 0.25));
    border-color: rgba(139, 92, 246, 0.6);
    color: #b7eaff;
    box-shadow: 0 0 20px rgba(125, 220, 255, 0.15);
}

/* Log out link in header nav for authenticated users */
.a0-logout-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 200ms ease;
    white-space: nowrap;
}
.a0-logout-link:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fecaca;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}
/* ── wall3t profile dropdown ────────────────────────────────── */
.a0-user-dropdown {
    position: relative;
    display: inline-block;
}

.a0-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #c4b5fd;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 200ms ease;
    white-space: nowrap;
    cursor: pointer;
}

.a0-profile-link:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
    color: #e0d0ff;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

.a0-dropdown-arrow {
    font-size: 10px;
    opacity: 0.7;
    transition: transform 200ms ease;
}

.a0-user-dropdown.open .a0-dropdown-arrow {
    transform: rotate(180deg);
}

.a0-dropdown-menu {
    display: none !important;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: #13131f;
    border: 1px solid #2a2a3a;
    border-radius: 10px;
    padding: 6px 0;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(99,102,241,0.1);
    animation: a0DropFade 150ms ease;
}

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

.a0-user-dropdown.open .a0-dropdown-menu {
    display: block !important;
}

.a0-dropdown-item {
    display: block;
    padding: 8px 16px;
    color: #aaa;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 150ms ease;
    white-space: nowrap;
}

.a0-dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #c4b5fd;
    padding-left: 20px;
}

.a0-dropdown-divider {
    height: 1px;
    background: #1e1e30;
    margin: 4px 0;
}

.a0-dropdown-logout {
    color: #fca5a5;
}

.a0-dropdown-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #fecaca;
}



/* Site version tag + theme toggle row — bottom of sidebar */
.a0-sidebar-version {
    margin-top: auto;
    padding: 8px 16px 8px;
    font-size: 9px;
    color: rgba(139, 92, 246, 0.25);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: opacity var(--a0-transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.a0-wrapper.closed .a0-sidebar-version {
    opacity: 0;
    pointer-events: none;
}

/* Theme toggle capsule */
.a0-theme-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 15px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    position: relative;
    background: rgba(139, 92, 246, 0.20);
    transition: background 0.3s ease;
    padding: 0;
    outline: none;
}
.a0-theme-toggle::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.50);
    transition: transform 0.3s ease, background 0.3s ease;
}
body.a0-light .a0-theme-toggle {
    background: rgba(99, 102, 241, 0.30);
}
body.a0-light .a0-theme-toggle::after {
    transform: translateX(13px);
    background: #6366f1;
}

/* ============================================
   LIGHT MODE OVERRIDES — body.a0-light
   ============================================ */
body.a0-light {
    background: #f0f0f5;
    color: #1a1a2e;
}
body.a0-light .grid-bg {
    opacity: 0.04;
}
body.a0-light .a0-sidebar-wrapper {
    background: #e8e8f0;
    border-right-color: rgba(99, 102, 241, 0.15);
}
body.a0-light .a0-sidebar-brand {
    border-bottom-color: rgba(99, 102, 241, 0.12);
}
body.a0-light .a0-brand-prompt,
body.a0-light .a0-brand-text {
    color: #4338ca;
}
body.a0-light .a0-sidebar-toggle {
    border-bottom-color: rgba(99, 102, 241, 0.10);
}
body.a0-light .a0-collapse-icon,
body.a0-light .a0-collapse-icon::before,
body.a0-light .a0-collapse-icon::after {
    background: #6366f1;
}
body.a0-light .a0-menu-tree a {
    color: #2d2d4e;
}
body.a0-light .a0-menu-tree a:hover,
body.a0-light .a0-menu-tree a.a0-active {
    color: #4338ca;
    background: rgba(99, 102, 241, 0.10);
}
body.a0-light .a0-sidebar-version {
    color: rgba(99, 102, 241, 0.35);
}
body.a0-light .a0-container-main {
    background: #f0f0f5;
}
body.a0-light .a0-site-header {
    background: rgba(240, 240, 245, 0.92);
    border-bottom-color: rgba(99, 102, 241, 0.12);
}
body.a0-light .a0-site-title,
body.a0-light .a0-subheading,
body.a0-light .a0-tagline {
    color: #1a1a2e;
}
body.a0-light .prompt {
    color: #4338ca;
}
body.a0-light .cursor {
    color: #6366f1;
}
body.a0-light .a0-main-content {
    color: #1a1a2e;
}
body.a0-light .a0-main-content a {
    color: #4338ca;
}
body.a0-light .a0-site-footer {
    border-top-color: rgba(99, 102, 241, 0.12);
    color: #6b7280;
}
body.a0-light .copyright {
    color: #6b7280;
}
body.a0-light .a0-toggler-burger {
    background: rgba(99, 102, 241, 0.10);
    border-color: rgba(99, 102, 241, 0.20);
}
body.a0-light .a0-burger-icon,
body.a0-light .a0-burger-icon::before,
body.a0-light .a0-burger-icon::after {
    background: #4338ca;
}
body.a0-light .a0-space-wrap a {
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.20);
    background: rgba(99, 102, 241, 0.06);
}
body.a0-light .a0-login-link {
    color: #4338ca;
    border-color: rgba(99, 102, 241, 0.30);
}
body.a0-light .a0-login-link:hover {
    background: rgba(99, 102, 241, 0.08);
}



/* ============================================
   LIGHT MODE — DJ Ymmude Player
   Override CSS custom properties on the player element
   ============================================ */
body.a0-light .dj-ymmude-player {
    --ymmude-bg: #f0f0f5;
    --ymmude-surface: #e4e4ef;
    --ymmude-surface-light: #d4d4e4;
    --ymmude-text: #1a1a2e;
    --ymmude-text-muted: #55556a;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10);
    border-color: rgba(99,102,241,0.20);
}
body.a0-light .ymmude-next-track {
    background: #e4e4ef;
}
body.a0-light .ymmude-progress-bar {
    background: #d4d4e4;
}
body.a0-light .ymmude-crate-select,
body.a0-light .ymmude-crate-name {
    background: #e4e4ef;
    border-color: rgba(99,102,241,0.20);
    color: #1a1a2e;
}
body.a0-light .ymmude-playlist-header {
    border-top-color: #d4d4e4;
}
body.a0-light .ymmude-track-item:hover {
    background: #d4d4e4;
}
body.a0-light .ymmude-track-item.active {
    background: #d4d4e4;
}

/* ============================================
   LIGHT MODE — Wall3t Widget
   ============================================ */
body.a0-light .wall3t-widget {
    background: #f0f0f5;
    border-color: rgba(99,102,241,0.20);
    color: #1a1a2e;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
body.a0-light .wall3t-custodial,
body.a0-light .wall3t-address {
    background: #e4e4ef;
    border-color: rgba(99,102,241,0.15);
}
body.a0-light .wall3t-custodial-label,
body.a0-light .wall3t-addr-label {
    color: #55556a;
}
body.a0-light .wall3t-guest {
    color: #55556a;
}
body.a0-light .wall3t-balance-label {
    color: #55556a;
}
body.a0-light .wall3t-balance-row {
    border-bottom-color: #d4d4e4;
}
body.a0-light .wall3t-earn-guide {
    background: #e4e4ef;
    border-color: rgba(99,102,241,0.15);
}
body.a0-light .wall3t-earn-item {
    color: #55556a;
}
body.a0-light .wall3t-history-row {
    color: #55556a;
    border-bottom-color: #d4d4e4;
}
body.a0-light .wall3t-history-empty {
    color: #8888a0;
}
body.a0-light .wall3t-holdings {
    background: rgba(99,102,241,0.04);
    border-color: rgba(99,102,241,0.15);
}
body.a0-light .wall3t-holdings-refresh {
    border-color: rgba(0,0,0,0.15);
    color: #1a1a2e;
}
body.a0-light .wall3t-holdings-loading,
body.a0-light .wall3t-holdings-empty {
    color: #55556a;
}
body.a0-light .wall3t-token-row:hover {
    background: rgba(99,102,241,0.06);
}
body.a0-light .wall3t-token-name {
    color: #55556a;
}
body.a0-light .wall3t-token-balance {
    color: #1a1a2e;
}
body.a0-light .wall3t-toast {
    background: #f0f0f5;
    border-color: rgba(99,102,241,0.20);
    color: #1a1a2e;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
body.a0-light .wall3t-btn-link {
    border-color: #c0c0d4;
    color: #55556a;
}
body.a0-light .wall3t-btn-disconnect {
    background: #fce8e8;
    border-color: #f0a0a0;
}

/* ============================================
   LIGHT MODE — Crypto Dashboard
   Override --a0-* CSS vars on the root element
   ============================================ */
body.a0-light .crypto-dashboard-root {
    --a0-bg: #f0f0f5;
    --a0-bg-2: #e4e4ef;
    --a0-text: #1a1a2e;
    --a0-text-dim: #55556a;
    --a0-border: rgba(99,102,241,0.18);
    --a0-border-hi: rgba(99,102,241,0.30);
    --a0-purple: #6366f1;
    --a0-cyan: #0891b2;
    --a0-green: #059669;
    --a0-mono: "SF Mono", "JetBrains Mono", "Fira Code", Consolas, monospace;
    background: radial-gradient(circle at top left, rgba(99,102,241,0.08), transparent 40%),
                linear-gradient(180deg, #e4e4ef 0%, #f0f0f5 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), inset 0 -10px 24px rgba(0,0,0,0.03);
    border-color: rgba(99,102,241,0.18);
}
body.a0-light .crypto-token-card {
    background: rgba(255,255,255,0.70);
    border-color: rgba(99,102,241,0.15);
}
body.a0-light .crypto-token-card:hover {
    background: rgba(255,255,255,0.95);
    border-color: #6366f1;
}
body.a0-light .crypto-modal-overlay {
    background: rgba(180,180,210,0.65);
}
body.a0-light .crypto-modal {
    background: #f0f0f5;
    border-color: rgba(99,102,241,0.25);
    color: #1a1a2e;
}
body.a0-light .crypto-detail-item {
    background: rgba(99,102,241,0.06);
}
body.a0-light .crypto-pair-row {
    border-bottom-color: rgba(99,102,241,0.12);
}
body.a0-light .crypto-chart-section {
    background: rgba(255,255,255,0.55);
    border-color: rgba(99,102,241,0.18);
}
body.a0-light .crypto-chart-tab {
    background: rgba(255,255,255,0.65);
    border-color: rgba(99,102,241,0.15);
    color: #55556a;
}
body.a0-light .crypto-chart-tab:hover {
    border-color: #6366f1;
    color: #1a1a2e;
    background: rgba(99,102,241,0.08);
}
body.a0-light .crypto-chart-tab.active {
    background: rgba(99,102,241,0.12);
    border-color: #6366f1;
    color: #6366f1;
}
body.a0-light .crypto-token-meta span {
    background: rgba(99,102,241,0.07);
}

/* ============================================
   LIGHT MODE — Footer background
   ============================================ */
body.a0-light .a0-site-footer {
    background: #e4e4ef;
}


/* ============================================
   Profile dropdown — CSS classes (replaces inline styles)
   ============================================ */
.a0-profile-btn {
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.4);
    border-radius: 8px;
    padding: 7px 14px;
    color: #c4b5fd;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.a0-profile-btn:hover { opacity: 0.85; }
.a0-profile-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 165px;
    background: #1a1a2e;
    border: 1px solid #2a2a3a;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    z-index: 99999;
    padding: 6px 0;
}
.a0-profile-link {
    display: block;
    padding: 9px 16px;
    color: #aaa;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}
.a0-profile-link:hover {
    color: #c4b5fd;
    background: rgba(99,102,241,0.12);
}
.a0-profile-logout { color: #fca5a5; }
.a0-profile-logout:hover {
    background: rgba(239,68,68,0.1);
    color: #fca5a5;
}
.a0-profile-sep {
    height: 1px;
    background: #2a2a3a;
    margin: 4px 0;
}

/* Light mode — dropdown */
body.a0-light .a0-profile-btn {
    background: rgba(99,102,241,0.10) !important;
    border-color: rgba(99,102,241,0.30) !important;
    color: #4338ca !important;
}
body.a0-light .a0-profile-panel {
    background: #f0f0f5 !important;
    border-color: rgba(99,102,241,0.20) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12) !important;
}
body.a0-light .a0-profile-link {
    color: #2d2d4e !important;
}
body.a0-light .a0-profile-link:hover {
    color: #4338ca !important;
    background: rgba(99,102,241,0.08) !important;
}
body.a0-light .a0-profile-sep {
    background: rgba(99,102,241,0.12) !important;
}
body.a0-light .a0-profile-logout {
    color: #dc2626 !important;
}
body.a0-light .a0-profile-logout:hover {
    background: rgba(239,68,68,0.06) !important;
    color: #dc2626 !important;
}

/* ============================================
   Wall3t light mode — !important to beat wall3t.css cascade order
   ============================================ */
body.a0-light .wall3t-widget {
    background: #f0f0f5 !important;
    border-color: rgba(99,102,241,0.20) !important;
    color: #1a1a2e !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12) !important;
}
body.a0-light .wall3t-custodial,
body.a0-light .wall3t-address {
    background: #e4e4ef !important;
    border-color: rgba(99,102,241,0.15) !important;
}
body.a0-light .wall3t-custodial-label,
body.a0-light .wall3t-addr-label,
body.a0-light .wall3t-guest,
body.a0-light .wall3t-balance-label,
body.a0-light .wall3t-earn-item,
body.a0-light .wall3t-history-row {
    color: #55556a !important;
}
body.a0-light .wall3t-balance-row {
    border-bottom-color: #d4d4e4 !important;
}
body.a0-light .wall3t-earn-guide {
    background: #e4e4ef !important;
    border-color: rgba(99,102,241,0.15) !important;
}
body.a0-light .wall3t-history-row {
    border-bottom-color: #d4d4e4 !important;
}
body.a0-light .wall3t-holdings {
    background: rgba(99,102,241,0.04) !important;
    border-color: rgba(99,102,241,0.15) !important;
}
body.a0-light .wall3t-token-row:hover {
    background: rgba(99,102,241,0.06) !important;
}
body.a0-light .wall3t-token-name {
    color: #55556a !important;
}
body.a0-light .wall3t-token-balance {
    color: #1a1a2e !important;
}
body.a0-light .wall3t-toast {
    background: #f0f0f5 !important;
    border-color: rgba(99,102,241,0.20) !important;
    color: #1a1a2e !important;
}

/* ============================================
   LLM Gateway light mode — !important to beat inline <style> block
   ============================================ */
body.a0-light .llmgw-site {
    color: #1a1a2e !important;
}
body.a0-light .llmgw-site h1,
body.a0-light .llmgw-site h2 {
    color: #4338ca !important;
}
body.a0-light .llmgw-site p {
    color: #55556a !important;
}
body.a0-light .llmgw-card {
    background: #e8e8f4 !important;
    border-color: rgba(99,102,241,0.20) !important;
}
body.a0-light .llmgw-table th {
    background: #dcdcec !important;
    color: #4338ca !important;
    border-bottom-color: rgba(99,102,241,0.25) !important;
}
body.a0-light .llmgw-table td {
    border-bottom-color: rgba(99,102,241,0.12) !important;
    color: #1a1a2e !important;
}
body.a0-light .llmgw-table tr:hover td {
    background: #dcdcec !important;
}
body.a0-light .llmgw-msg-ok {
    background: #ecfdf5 !important;
    color: #065f46 !important;
    border-color: #10b981 !important;
}
body.a0-light .llmgw-msg-err {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border-color: #dc2626 !important;
}
body.a0-light .code-block {
    background: #1a1a2e !important;
    border-color: rgba(99,102,241,0.20) !important;
    color: #06b6d4 !important;
}
body.a0-light input[type="text"].llmgw-input,
body.a0-light .llmgw-card input[type="text"] {
    background: #dcdcec !important;
    border-color: rgba(99,102,241,0.25) !important;
    color: #1a1a2e !important;
}


/* ============================================
   LIGHT MODE — wall3t full-page component (com_wall3t)
   Uses CSS attribute selectors to beat inline style= dark colors
   !important overrides inline styles when body.a0-light is set
   ============================================ */

/* Main page text */
body.a0-light .wall3t-page {
    color: #1a1a2e !important;
}

/* Dark card backgrounds #13131f */
body.a0-light .wall3t-page [style*="background:#13131f"] {
    background: #e8e8f4 !important;
    border-color: rgba(99,102,241,0.20) !important;
}

/* Gradient balance card */
body.a0-light .wall3t-page [style*="background:linear-gradient(135deg,#13131f"] {
    background: linear-gradient(135deg, #e4e4ef, #ebebf5) !important;
    border-color: rgba(99,102,241,0.20) !important;
}

/* Mid dark #1a1a2e */
body.a0-light .wall3t-page [style*="background:#1a1a2e"] {
    background: #dcdcec !important;
    border-color: rgba(99,102,241,0.15) !important;
}

/* Darkest #0f0f14 */
body.a0-light .wall3t-page [style*="background:#0f0f14"] {
    background: #e0e0f0 !important;
    border-color: rgba(99,102,241,0.15) !important;
}

/* Tab nav separator border */
body.a0-light .wall3t-page [style*="border-bottom:1px solid #1e1e30"] {
    border-bottom-color: rgba(99,102,241,0.18) !important;
}

/* Muted text — grey tones */
body.a0-light .wall3t-page [style*="color:#666"],
body.a0-light .wall3t-page [style*="color:#aaa"],
body.a0-light .wall3t-page [style*="color:#888"],
body.a0-light .wall3t-page [style*="color:#777"],
body.a0-light .wall3t-page [style*="color:#555"] {
    color: #55556a !important;
}

/* Main text */
body.a0-light .wall3t-page [style*="color:#e0e0f0"],
body.a0-light .wall3t-page [style*="color:#e0e0e0"],
body.a0-light .wall3t-page [style*="color:#cbd5e1"] {
    color: #1a1a2e !important;
}

/* Inputs and selects */
body.a0-light .wall3t-page input[type="text"],
body.a0-light .wall3t-page select {
    background: #dcdcec !important;
    border-color: rgba(99,102,241,0.20) !important;
    color: #1a1a2e !important;
}

/* Heading purple */
body.a0-light .wall3t-page [style*="color:#c4b5fd"] {
    color: #4338ca !important;
}

/* Active tab */
body.a0-light .wall3t-page a[style*="background:#13131f"] {
    background: #dcdcec !important;
    border-color: rgba(99,102,241,0.25) !important;
    color: #4338ca !important;
}

/* Inactive tab link */
body.a0-light .wall3t-page a[style*="color:#666"] {
    color: #55556a !important;
}

/* Swap output preview */
body.a0-light .wall3t-page [style*="color:#a78bfa"] {
    color: #6366f1 !important;
}

/* Footer address line */
body.a0-light .wall3t-page [style*="border:1px solid #1e1e30"] {
    background: #e4e4ef !important;
    border-color: rgba(99,102,241,0.15) !important;
}

/* Chain badge */
body.a0-light .wall3t-page [style*="background:#1e3a5f"] {
    background: rgba(99,102,241,0.12) !important;
    color: #4338ca !important;
}

/* MAX / utility buttons */
body.a0-light .wall3t-page [style*="background:#2a2a3a"] {
    background: #d4d4e8 !important;
    border-color: rgba(99,102,241,0.20) !important;
    color: #4338ca !important;
}


/* ============================================
   Sidebar menu icons — collapsed state centering
   When sidebar is closed (60px), center the icon in the strip
   ============================================ */
.a0-wrapper.closed .a0-menu-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
.a0-wrapper.closed .a0-menu-icon {
    /* a0-menu-icon collapsed centering */
    width: auto;
    font-size: 16px;
}

/* My Space link icon (hardcoded in index.php — uses ::before) */
.a0-space-link::before {
    content: "C6";   /* ◆ diamond */
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    display: inline-block;
    font-style: normal;
}
.a0-wrapper.closed .a0-space-wrap .a0-space-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
.a0-wrapper.closed .a0-space-wrap .a0-space-link::before {
    width: auto;
    font-size: 16px;
}
.a0-wrapper.closed .a0-space-wrap .a0-space-link span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}


/* Space Agent logo img icon */
.a0-menu-icon-img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
    border-radius: 3px;
    opacity: 0.7;
    transition: opacity 180ms ease;
}
.a0-menu-link:hover .a0-menu-icon-img,
.a0-menu-link.active .a0-menu-icon-img {
    opacity: 1;
}
