/* ===========================================
   Global typography and fonts
   =========================================== */
@import url('/static/global/typography.css');


/* ===========================================
   Aether Global Palette (Deeper & Sharper)
   =========================================== */

:root {
    /* Base: Colder, deeper space black */
    --onyx-bg: #00030A;
    --onyx-bg-accent-1: #030810;
    --onyx-bg-accent-2: #02050D;

    --onyx-surface: #060912; /* Slightly darker surface for cards */
    --onyx-surface-soft: #080C1A;
    --onyx-border-subtle: #141A2E; /* Richer, darker blue border */

    --onyx-text-main: #eff1ff;
    --onyx-text-muted: #8c96bc;

    /* Accent: Sharper, more electric cyan/blue */
    --onyx-accent: #34D3FC;
    --onyx-accent-soft: #63b3ed;
}


/* ===========================================
   Base layout + static deep-space background
   =========================================== */

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;

    /* Same base background as login */
    background:
        radial-gradient(circle at 0% 0%, #1f2435 0%, transparent 45%),
        radial-gradient(circle at 100% 100%, #14141f 0%, transparent 55%),
        var(--onyx-bg);

    background-size:
        auto,
        auto,
        auto;

    color: var(--onyx-text-main);
    position: relative; /* so ::before overlay sits behind content */
}

/* ===========================================
   App Container and Content Area
   =========================================== */

#app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

#content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
    background: transparent;
    position: relative;
    z-index: 1;
}

/* ===========================================
   Animated constellation overlay (all pages)
   =========================================== */

/* body::before {
    content: "";
    position: fixed;
    inset: -80px;
    pointer-events: none;
    z-index: 0;

    background:

        radial-gradient(circle 3px at 16% 22%, rgba(191, 219, 254, 0.7) 0%, transparent 75%),
        radial-gradient(circle 3px at 38% 68%, rgba(125, 211, 252, 0.7) 0%, transparent 75%),
        radial-gradient(circle 4px at 74% 30%, rgba(56, 189, 248, 0.75) 0%, transparent 75%),
        radial-gradient(circle 3px at 82% 76%, rgba(94, 234, 212, 0.75) 0%, transparent 75%),
        radial-gradient(circle 3px at 30% 80%, rgba(226, 232, 240, 0.7) 0%, transparent 75%),

        linear-gradient(
            120deg,
            rgba(56, 189, 248, 0.28) 0px,
            rgba(56, 189, 248, 0.28) 1px,
            transparent 1px,
            transparent 90px
        ),
        linear-gradient(
            300deg,
            rgba(37, 99, 235, 0.24) 0px,
            rgba(37, 99, 235, 0.24) 1px,
            transparent 1px,
            transparent 110px
        );

    background-size:
        320px 320px,
        360px 360px,
        420px 420px,
        380px 380px,
        340px 340px,

        260px 260px,
        260px 260px;

    mix-blend-mode: screen;
    opacity: 0.28; 

    will-change: background-position, transform;
    animation: onyxConstellation 46s ease-in-out infinite;
}


@keyframes onyxConstellation {
    0% {
        background-position:
            0px 0px,
            40px -20px,
            -30px 30px,
            20px 60px,
            -40px 50px,

            0px 0px,
            0px 0px;
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        background-position:
            -80px -60px,
            110px -20px,
            -20px 60px,
            -20px 100px,
            -100px 80px,

            -160px -110px,
            160px 110px;
        transform: translate3d(0, -10px, 0) scale(1.02);
    }
    100% {
        background-position:
            -160px -120px,
            150px 0px,
            0px 75px,
            -30px 135px,
            -180px 105px,

            -320px -220px,
            320px 220px;
        transform: translate3d(0, 0, 0) scale(1);
    }
} */


/* ===========================================
   Sidebar / Side menu (premium graphite)
   =========================================== */

#side-menu {
    width: 250px;
    min-width: 60px;
    background-color: var(--onyx-surface);
    border-right: 1px solid var(--onyx-border-subtle);
    box-shadow: 8px 0 25px rgba(0,0,0,0.7);
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    color: #f5f5f5;
    transition: width 0.3s ease, transform 0.25s ease-out;
    z-index: 1000;
}

#side-menu.collapsed {
    width: 60px;
}

/* typography control */
#side-menu,
#side-menu a,
.menu-title {
    font-family: 'Inter', sans-serif;
}

.menu-section-name {
    font-family: 'Space Grotesk', sans-serif;
}


/* ===========================================
   Sidebar Header
   =========================================== */

#menu-header {
    position: sticky;
    top: 0;
    z-index: 100;

    /* tuned to visually match the common.css top bar */
    height: 65px;
    padding: 0 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    /* SAME matte metal family as .form-bar, slightly darker */
    background:
      linear-gradient(
        180deg,
        rgba(2, 5, 13, 0.95) 0%,
        rgba(0, 3, 10, 0.98) 100%
      ),
      radial-gradient(circle at 0% 0%, #161922 0%, #0b0d12 55%, #050509 100%);

    border-bottom: 1px solid rgba(255, 255, 255, 0.04);

    box-shadow:
      0 14px 32px rgba(0, 0, 0, 0.75),
      inset 0 0 0 1px rgba(0, 0, 0, 0.70);

    box-sizing: border-box;
    flex: 0 0 65px;
    min-height: 65px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* ensure logo and text share a clean vertical center */
.header-content img {
    display: block;
}

.menu-title {
    font-size: 14px;
    color: white;
    line-height: 1;
    display: flex;
    align-items: center;
}


/* desktop menu toggle */
#toggle-menu {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* hide labels when collapsed */
#side-menu.collapsed .header-content,
#side-menu.collapsed .menu-section-name,
#side-menu.collapsed a span {
    display: none;
}

#side-menu.collapsed a {
    text-align: center;
}


/* ===========================================
   Menu Sections
   =========================================== */

.menu-section {
    padding-top: 14px;
}

.menu-section:not(:last-child) {
    margin-bottom: 8px;
}

.menu-section-name {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #7a7a7a;
    padding: 0 18px;
    margin: 16px 0 6px;
}


/* ===========================================
   Menu Items (buttons)
   =========================================== */

#side-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    text-decoration: none;
    color: #e8e8e8;
    font-size: 13px;
    border-radius: 10px;
    margin: 2px 10px;
    transition:
        background-color 0.16s ease-out,
        color 0.16s ease-out,
        transform 0.12s ease-out,
        box-shadow 0.16s ease-out;
}

#side-menu a span {
    margin-left: 0;
}

/* Hover effect: Subtle glow on hover */
#side-menu a:hover {
    background: var(--onyx-surface-soft);
    transform: translateX(2px);
    box-shadow: 0 4px 18px rgba(52, 211, 252, 0.15);
}


/* ===========================================
   Active Link (clean, premium highlight)
   =========================================== */

#side-menu a.active {
    background: var(--onyx-surface-soft);
    color: #ffffff;
    position: relative;
    border-radius: 8px;
    transform: translateX(1px);
    box-shadow: 0 0 15px rgba(52, 211, 252, 0.2);
}

#side-menu a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 3px;
    background: var(--onyx-accent);
}


/* ===========================================
   Content Area (already adjusted above)
   =========================================== */

/* Optional helpers */
.onyx-page {
    padding: 24px 32px;
    box-sizing: border-box;
}

.onyx-card {
    background: var(--onyx-surface-soft);
    border-radius: 12px;
    border: 1px solid var(--onyx-border-subtle);
    /* Deeper card shadow with subtle internal glow for premium effect */
    box-shadow: 0 0 50px rgba(52, 211, 252, 0.05),
                0 16px 40px rgba(0, 0, 0, 0.75);
    padding: 16px 18px;
    box-sizing: border-box;
}


/* ===========================================
   Scrollbar (hidden)
   =========================================== */

::-webkit-scrollbar {
    width: 0;
    background: transparent;
}


/* ===========================================
   Mobile Top Bar
   =========================================== */

#mobile-topbar {
    display: none;
    height: 48px;
    background-color: #181818;
    color: #fff;
    padding: 0 12px;
    box-sizing: border-box;
    align-items: center;
    justify-content: space-between;
    z-index: 1100;
}

#mobile-toggle-menu {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
}

#mobile-topbar-title {
    font-size: 14px;
    font-weight: 500;
}


/* ===========================================
   Tablet breakpoint
   =========================================== */

@media (max-width: 900px) {
    #side-menu {
        width: 200px;
    }

    #side-menu.collapsed {
        width: 60px;
    }

    #side-menu a {
        font-size: 13px;
        padding: 12px;
    }

    .menu-section-name {
        font-size: 11px;
    }
}


/* ===========================================
   Mobile breakpoint
   =========================================== */

@media (max-width: 768px) {
    #app-container {
        position: relative;
    }

    #mobile-topbar {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }

    #side-menu {
        position: fixed;
        top: 48px;
        left: 0;
        bottom: 0;
        height: calc(100vh - 48px);
        width: 240px;
        min-width: 240px;
        transform: translateX(-100%);
    }

    #side-menu.collapsed {
        width: 240px;
    }

    #side-menu.open {
        transform: translateX(0);
    }

    #content {
        flex: 1;
        padding-top: 48px;
    }

    #toggle-menu {
        display: none;
    }

    #side-menu a {
        font-size: 14px;
        padding: 12px 16px;
    }

    .menu-section-name {
        display: block;
        font-size: 11px;
    }
}


/* ===========================================
   Global loading spinner
   =========================================== */

.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 30, 30, 0.7);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
}

.spinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid var(--onyx-accent);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* ==== Onyx sidebar header micro-alignment ==== */

#menu-header .header-content img {
  display: block;
  height: 30px;
  width: auto;
}

#menu-header .menu-title {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  transform: translateY(4px);
}
