/* Omniverse — style.css */

/* ── Theme variables ───────────────────────────────────────────────────── */
:root {
    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-size-base: 15px;
}

[data-theme="dark"] {
    --bg:        #0F1923;
    --surface:   #1A2535;
    --surface2:  #223045;
    --border:    #2A3A50;
    --navy:      #1B2A4A;
    --steel:     #2E4D7B;
    --blue:      #4472C4;
    --text:      #E8EDF5;
    --subtext:   #8A9BB5;
    --green-bg:  #1A2E1A;
    --green-fg:  #81C784;
    --amber-bg:  #2E2510;
    --amber-fg:  #FFD54F;
    --red-bg:    #2E1010;
    --red-fg:    #EF9A9A;
    --success-bg:#E2EFDA;
    --success-fg:#375623;
    --warn-bg:   #FFF2CC;
    --warn-fg:   #7F4F00;
    --err-bg:    #F4CCCC;
    --err-fg:    #9C0006;
}

[data-theme="light"] {
    --bg:        #F4F6F9;
    --surface:   #FFFFFF;
    --surface2:  #EEF1F5;
    --border:    #D0D8E4;
    --navy:      #1B2A4A;
    --steel:     #2E4D7B;
    --blue:      #4472C4;
    --text:      #1A2535;
    --subtext:   #5A6A80;
    --green-bg:  #E2EFDA;
    --green-fg:  #375623;
    --amber-bg:  #FFF2CC;
    --amber-fg:  #7F4F00;
    --red-bg:    #F4CCCC;
    --red-fg:    #9C0006;
    --success-bg:#E2EFDA;
    --success-fg:#375623;
    --warn-bg:   #FFF2CC;
    --warn-fg:   #7F4F00;
    --err-bg:    #F4CCCC;
    --err-fg:    #9C0006;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-ui);
    font-size: var(--font-size-base);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background 0.2s, color 0.2s;
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
    background: var(--navy);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand {
    font-weight: 700;
    font-size: 16px;
    color: #E8EDF5;
    text-decoration: none;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
.desktop-nav { display: flex; gap: 0.2rem; align-items: center; }
.nav-link {
    color: #8A9BB5;
    text-decoration: none;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.15s;
}
.nav-link:hover  { background: var(--surface); color: #E8EDF5; }
.nav-link.active { background: var(--steel);   color: #E8EDF5; }
.nav-logout      { color: var(--red-fg) !important; }

/* ── Hamburger ──────────────────────────────────────────────────────────── */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #E8EDF5;
    border-radius: 2px;
    transition: all 0.2s;
}

/* ── Mobile drawer ──────────────────────────────────────────────────────── */
.mobile-drawer {
    position: fixed;
    top: 0; right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--navy);
    z-index: 200;
    transition: right 0.25s ease;
    display: flex;
    flex-direction: column;
}
.mobile-drawer.open { right: 0; }
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    color: #E8EDF5;
    height: 52px;
}
.drawer-close {
    background: none;
    border: none;
    color: #8A9BB5;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
}
.drawer-nav { display: flex; flex-direction: column; padding: 0.75rem 0; flex: 1; overflow-y: auto; }
.drawer-link {
    color: #8A9BB5;
    text-decoration: none;
    padding: 0.85rem 1.5rem;
    font-size: 15px;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.drawer-link:hover  { background: var(--surface); color: #E8EDF5; }
.drawer-link.active { background: var(--surface); color: #E8EDF5; border-left-color: var(--blue); }
.drawer-logout      { color: var(--red-fg) !important; }
.drawer-divider     { height: 1px; background: var(--border); margin: 0.5rem 1rem; }

.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
}
.drawer-overlay.open { display: block; }

.drawer-bottom { margin-top: auto; padding-bottom: 1rem; }

/* ── Main ───────────────────────────────────────────────────────────────── */
.main-content { padding: 1.5rem; max-width: 1100px; margin: 0 auto; }

/* ── Page header ────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 22px; font-weight: 600; }
.page-header p  { color: var(--subtext); margin-top: 0.25rem; font-size: 13px; }

/* ── Status bar ─────────────────────────────────────────────────────────── */
.status-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.status-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}
.status-pill.green  { background: var(--green-bg); color: var(--green-fg); border-color: var(--green-fg); }
.status-pill.amber  { background: var(--amber-bg); color: var(--amber-fg); border-color: var(--amber-fg); }
.status-pill.red    { background: var(--red-bg);   color: var(--red-fg);   border-color: var(--red-fg); }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s;
}
.card:hover { border-color: var(--blue); transform: translateY(-2px); }
.card-icon  { font-size: 2.5rem; }
.card-img   { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; }
.card-title { font-weight: 700; font-size: 16px; }
.card-sub   { color: var(--subtext); font-size: 12px; }
.card-status{ font-size: 11px; padding: 0.2rem 0.6rem; border-radius: 10px; margin-top: 0.25rem; }
.card-status.paper { background: var(--amber-bg); color: var(--amber-fg); }
.card-status.live  { background: var(--green-bg); color: var(--green-fg); }

/* ── Info cards ─────────────────────────────────────────────────────────── */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}
.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
}
.info-label { font-size: 11px; color: var(--subtext); text-transform: uppercase; letter-spacing: 0.05em; }
.info-value { font-size: 20px; font-weight: 700; margin-top: 0.25rem; }
.info-sub   { font-size: 11px; color: var(--subtext); margin-top: 0.15rem; }

/* ── Login ──────────────────────────────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}
.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
}
.login-box h1   { font-size: 24px; font-weight: 700; margin-bottom: 0.5rem; }
.login-subtitle { color: var(--subtext); font-size: 13px; margin-bottom: 1.5rem; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-group       { margin-bottom: 1rem; text-align: left; }
.form-group label { display: block; font-size: 12px; color: var(--subtext);
                    margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input,
.form-group select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    color: var(--text);
    font-size: var(--font-size-base);
    font-family: var(--font-ui);
    outline: none;
    transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus { border-color: var(--blue); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    font-family: var(--font-ui);
}
.btn-primary { background: var(--blue);  color: white; }
.btn-primary:hover { background: var(--steel); }
.btn-success { background: #2E7D32; color: white; }
.btn-danger  { background: #C62828; color: white; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-full    { width: 100%; margin-top: 0.5rem; }
.btn-sm      { padding: 0.35rem 0.75rem; font-size: 12px; }

/* ── Flash messages ─────────────────────────────────────────────────────── */
.flash-container { padding: 0.75rem 1.5rem 0; }
.flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 14px;
}
.flash-error   { background: var(--err-bg);     color: var(--err-fg); }
.flash-success { background: var(--success-bg); color: var(--success-fg); }
.flash-warning { background: var(--warn-bg);    color: var(--warn-fg); }

/* ── Settings ───────────────────────────────────────────────────────────── */
.settings-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.settings-section h2 {
    font-size: 13px;
    color: var(--subtext);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: 14px; flex: 1; }
.settings-sub   { font-size: 12px; color: var(--subtext); margin-top: 2px; }

/* Theme toggle buttons */
.theme-group { display: flex; gap: 0.5rem; }
.theme-btn {
    padding: 0.35rem 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--subtext);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.theme-btn.active,
.theme-btn:hover { background: var(--blue); color: white; border-color: var(--blue); }

/* Font size stepper */
.fsize-group { display: flex; align-items: center; gap: 0.5rem; }
.fsize-btn   { width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border);
               background: var(--surface2); color: var(--text); font-size: 16px;
               cursor: pointer; display: flex; align-items: center; justify-content: center; }
.fsize-val   { min-width: 36px; text-align: center; font-weight: 600; font-size: 14px; }

/* Token status */
.token-status { display: flex; align-items: center; gap: 0.5rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--green-fg); }
.dot-red   { background: var(--red-fg); }

/* ── Misc ───────────────────────────────────────────────────────────────── */
.coming-soon { color: var(--subtext); font-style: italic; padding: 2rem 0; text-align: center; }
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .desktop-nav { display: none; }
    .hamburger   { display: flex; }
    .main-content { padding: 1rem; }
    .card-grid { grid-template-columns: 1fr 1fr; } /* 2-col on mobile */
    .login-box { margin: 1rem; padding: 1.5rem; }
    .info-grid { grid-template-columns: 1fr 1fr; }
    .settings-row { flex-wrap: wrap; }
    .page-header h1 { font-size: 18px; }
}

@media (max-width: 360px) {
    .card-grid { grid-template-columns: 1fr; }
}

/* Last card spans full width if odd number */
.card-grid .card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 50%;
    margin: 0 auto;
    width: 100%;
}

/* ── Vantage alias variables ─────────────────────────────────────────────
   Maps Vantage dashboard CSS vars to Omniverse's existing design tokens.
   ──────────────────────────────────────────────────────────────────────── */
[data-theme="light"], [data-theme="dark"] {
    --accent:     var(--blue);
    --success:    var(--green-fg);
    --danger:     var(--red-fg);
    --text-muted: var(--subtext);
}

/* ── Login page ──────────────────────────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}
.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    text-align: center;
}
.login-box h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}
.login-subtitle {
    color: var(--subtext);
    font-size: 0.85rem;
    margin-bottom: 1.75rem;
}
.form-group {
    text-align: left;
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--subtext);
    margin-bottom: 0.4rem;
}
.form-group input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--surface2);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s;
}
.form-group input:focus {
    border-color: var(--blue);
}
.btn-primary {
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.88; }
.btn-full { width: 100%; margin-top: 0.5rem; }
.flash-error {
    background: var(--err-bg);
    color: var(--err-fg);
    border-radius: 7px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    text-align: left;
}

/* ── Vantage button color fix ─────────────────────────────────────────── */
[data-theme="light"] {
    --success: #16a34a;
    --danger:  #dc2626;
}
[data-theme="dark"] {
    --success: #22c55e;
    --danger:  #ef4444;
}
