/* ============================================================
   OPS.EA-SD.COM - METALLIC THEME SYSTEM
   ============================================================
   6 Metallic Color Themes with Shimmering Borders
   ============================================================ */

/* ============================================================
   SECTION: BASE VARIABLES
   ============================================================ */
:root {
    /* Layout */
    --nav-width: 60px;
    --sidebar-width: 240px;
    --topbar-height: 50px;
    
    /* Base Colors */
    --bg-primary: #0a0e14;
    --bg-secondary: #1a1f28;
    --bg-tertiary: #23282f;
    --bg-hover: rgba(255, 255, 255, 0.05);
    
    /* Text */
    --text-primary: #e8eaed;
    --text-secondary: #b0b3b8;
    --text-tertiary: #8a8d91;
    
    /* Borders */
    --border-base: rgba(255, 255, 255, 0.08);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* ============================================================
   SECTION: METALLIC THEMES
   ============================================================ */

/* GOLD METALLIC (Default) */
:root[data-theme="gold"],
:root {
    --metallic-base: #ffd700;
    --metallic-light: #ffe84d;
    --metallic-dark: #ccac00;
    --metallic-rgb: 255, 215, 0;
    --metallic-glow: rgba(255, 215, 0, 0.4);
}

/* SILVER/CHROME METALLIC */
:root[data-theme="silver"] {
    --metallic-base: #c0c0c0;
    --metallic-light: #e8e8e8;
    --metallic-dark: #909090;
    --metallic-rgb: 192, 192, 192;
    --metallic-glow: rgba(192, 192, 192, 0.4);
}

/* BLUE METALLIC */
:root[data-theme="blue"] {
    --metallic-base: #4a9eff;
    --metallic-light: #6bb0ff;
    --metallic-dark: #3b7ecc;
    --metallic-rgb: 74, 158, 255;
    --metallic-glow: rgba(74, 158, 255, 0.4);
}

/* RED METALLIC */
:root[data-theme="red"] {
    --metallic-base: #ff4444;
    --metallic-light: #ff6666;
    --metallic-dark: #cc3636;
    --metallic-rgb: 255, 68, 68;
    --metallic-glow: rgba(255, 68, 68, 0.4);
}

/* GREEN/EMERALD METALLIC */
:root[data-theme="green"] {
    --metallic-base: #00d4aa;
    --metallic-light: #00e5bf;
    --metallic-dark: #00a885;
    --metallic-rgb: 0, 212, 170;
    --metallic-glow: rgba(0, 212, 170, 0.4);
}

/* ORANGE/COPPER METALLIC */
:root[data-theme="orange"] {
    --metallic-base: #ff8800;
    --metallic-light: #ffa033;
    --metallic-dark: #cc6d00;
    --metallic-rgb: 255, 136, 0;
    --metallic-glow: rgba(255, 136, 0, 0.4);
}

/* ============================================================
   SECTION: RESET & BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(var(--metallic-rgb), 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--metallic-rgb), 0.5);
}

/* ============================================================
   SECTION: LAYOUT
   ============================================================ */
.app {
    display: flex;
    height: 100vh;
}

/* Left Nav */
.left-nav {
    width: var(--nav-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-base);
    display: flex;
    flex-direction: column;
}

/* Main Area */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Top Bar */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-base);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
}

/* Workspace */
.workspace {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* ============================================================
   SECTION: METALLIC CARDS
   ============================================================ */
.card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    padding: 2px;
    background: linear-gradient(
        135deg,
        var(--metallic-light),
        var(--metallic-base),
        var(--metallic-dark),
        var(--metallic-base),
        var(--metallic-light)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(var(--metallic-rgb), 0.3),
        transparent
    );
    animation: shimmer 3s infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--metallic-rgb), 0.2);
}

/* Metallic Glow on Hover */
.card:hover::before {
    box-shadow: 
        0 0 20px var(--metallic-glow),
        inset 0 0 10px rgba(var(--metallic-rgb), 0.1);
}

/* ============================================================
   SECTION: NAV ITEMS
   ============================================================ */
.nav-item {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 1.25rem;
    text-decoration: none;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    padding: 1px;
    background: transparent;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--metallic-base);
}

.nav-item:hover::before {
    background: linear-gradient(135deg, var(--metallic-light), var(--metallic-base));
    opacity: 1;
}

.nav-item.active {
    background: rgba(var(--metallic-rgb), 0.1);
    color: var(--metallic-base);
}

.nav-item.active::before {
    background: linear-gradient(135deg, var(--metallic-base), var(--metallic-light));
    opacity: 1;
    box-shadow: 0 0 10px var(--metallic-glow);
}

/* ============================================================
   SECTION: BUTTONS
   ============================================================ */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--metallic-base), var(--metallic-dark));
    color: var(--bg-primary);
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--metallic-light), var(--metallic-base));
    box-shadow: 0 4px 12px var(--metallic-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid rgba(var(--metallic-rgb), 0.3);
}

.btn-secondary:hover {
    border-color: var(--metallic-base);
    box-shadow: 0 0 10px rgba(var(--metallic-rgb), 0.2);
}

/* ============================================================
   SECTION: TABLES
   ============================================================ */
.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-base);
    border-radius: 8px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-tertiary);
}

th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(var(--metallic-rgb), 0.2);
}

tbody tr {
    border-bottom: 1px solid var(--border-base);
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: var(--bg-hover);
}

td {
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* ============================================================
   SECTION: BADGES & STATUS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid;
}

.badge-primary {
    background: rgba(var(--metallic-rgb), 0.15);
    color: var(--metallic-base);
    border-color: rgba(var(--metallic-rgb), 0.3);
}

.badge-success {
    background: rgba(0, 212, 170, 0.15);
    color: #00d4aa;
    border-color: rgba(0, 212, 170, 0.3);
}

.badge-warning {
    background: rgba(255, 170, 0, 0.15);
    color: #ffaa00;
    border-color: rgba(255, 170, 0, 0.3);
}

.badge-danger {
    background: rgba(255, 68, 68, 0.15);
    color: #ff4444;
    border-color: rgba(255, 68, 68, 0.3);
}

/* ============================================================
   SECTION: UTILITIES
   ============================================================ */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-metallic { color: var(--metallic-base); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }