/* SpyQiNex Unified Theme — Dark-First Design (matches mobile palette) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== DEFAULT (DARK) THEME ===== */
body {
    font-family: 'Cavolini', Arial, sans-serif;
    background-color: #0d0f14;
    color: #e8eaf0;
    min-height: 100vh;
    padding: 20px;
    overflow-x: auto;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
        overflow-x: hidden;
    }

    .container {
        border-radius: 0;
        width: 100%;
        min-width: 0 !important;
        box-shadow: none;
        overflow: hidden;
    }

    .header {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .header-content {
        flex-direction: column;
        gap: 5px;
    }

    .header-logo {
        height: 75px;
    }

    .tabs {
        padding: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
    }

    .tab {
        padding: 12px 15px;
        white-space: nowrap;
        font-size: 13px;
        flex: 0 0 auto;
    }

    .tab-content {
        padding: 15px;
    }
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    background: #161a23;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    min-width: 1200px;
    color: #e8eaf0;
}

.header {
    background: linear-gradient(135deg, #161a23 0%, #0d0f14 100%);
    color: #ffffff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
    border-bottom: 2px solid #f0a500;
    font-family: 'Cavolini', Arial, sans-serif;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 75px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.header-text {
    display: flex;
    flex-direction: column;
}

.punchline {
    font-size: 13px;
    font-style: italic;
    opacity: 0.95;
    margin-top: 4px;
    color: #dbe4ff;
    font-weight: 500;
}

/* Tabs */
.tabs {
    display: flex;
    flex-wrap: nowrap;
    background: #161a23;
    padding: 6px 10px;
    gap: 3px;
    border-bottom: 1px solid #2a3044;
    margin-bottom: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.tab {
    padding: 5px 8px;
    cursor: pointer;
    border: none;
    background: #252b3b;
    font-size: 10px;
    font-weight: 700;
    color: #8891b0;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
    transform: rotateX(15deg) translateY(0);
    box-shadow: 0 3px 0 #0d0f14, 0 6px 12px rgba(0, 0, 0, 0.4);
    text-decoration: none;
}

.tab:hover {
    transform: rotateX(10deg) translateY(-2px);
    background: #353d55;
    color: #ffffff;
    box-shadow: 0 6px 0 #0d0f14, 0 10px 20px rgba(0, 0, 0, 0.45);
}

.tab.active {
    transform: rotateX(0deg) translateY(2px);
    color: #000000;
    background: linear-gradient(135deg, #f0a500, #d4940a);
    box-shadow: 0 0px 0 #d4940a, inset 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 800;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.tab-content {
    display: none;
    padding: 30px;
    color: #e8eaf0;
}

.tab-content.active {
    display: block !important;
    opacity: 1 !important;
}

/* Dark theme table defaults */
th {
    background: #1e2330;
    color: #e8eaf0;
}

td {
    color: #8891b0;
    border-bottom: 1px solid #2a3044;
}

/* Dark theme forms */
input[type="number"],
input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
    background: #161a23;
    color: #e8eaf0;
    border: 1px solid #2a3044;
    border-radius: 6px;
    font-family: 'Cavolini', Arial, sans-serif;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #f0a500;
    box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.15);
}

/* Status bar */
.status-bar {
    background: #1e2330;
    border: 1px solid #2a3044;
    border-radius: 8px;
}

/* Ticker sections */
.ticker-section {
    background: #1e2330;
    border: 1px solid #2a3044;
    border-radius: 12px;
}

/* Settings / config sections */
.settings-section,
.config-section {
    background: #1e2330;
    border: 1px solid #2a3044;
    border-radius: 12px;
}

/* Positions / cards */
.position-card,
.positions-container {
    background: #1e2330;
    border: 1px solid #2a3044;
}

/* Logs */
.logs-container {
    background: #0d0f14;
    color: #6b7394;
    border: 1px solid #2a3044;
}

.log-entry {
    border-bottom: 1px solid #2a3044;
}

/* Labels */
.stat-label,
.detail-label {
    color: #6b7394;
}

.stat-value,
.detail-value {
    color: #e8eaf0;
}

/* Headings */
h2,
h3,
h4,
h5 {
    color: #e8eaf0;
}

/* Watermark */
body::before {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    width: 70vw;
    height: 70vh;
    transform: translate(-50%, -50%);
    background-image: url('/LOGO-1.png?v=4');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.02;
    z-index: 9999;
    pointer-events: none;
    mix-blend-mode: screen;
}

/* 3D Button Style (Same as Tab but standalone) */
.btn-3d {
    padding: 8px 12px;
    cursor: pointer;
    border: none;
    background: #252b3b;
    font-size: 11px;
    font-weight: 700;
    color: #e8eaf0;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transform: rotateX(15deg) translateY(0);
    box-shadow: 0 4px 0 #0d0f14, 0 8px 15px rgba(0, 0, 0, 0.4);
    text-decoration: none;
}

.btn-3d:hover {
    transform: rotateX(10deg) translateY(-2px);
    background: #353d55;
    color: #ffffff;
    box-shadow: 0 6px 0 #0d0f14, 0 10px 20px rgba(0, 0, 0, 0.45);
}

.btn-3d:active {
    transform: rotateX(0deg) translateY(2px);
    background: linear-gradient(135deg, #f0a500, #d4940a);
    box-shadow: 0 0px 0 #d4940a, inset 0 2px 4px rgba(0, 0, 0, 0.3);
    color: #000;
}

/* ===== LIGHT THEME OVERRIDES ===== */
[data-theme="light"] body,
html[data-theme="light"] body {
    background-color: #f0f4f8;
    color: #1a202c;
}

html[data-theme="light"] .container {
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    color: #1a202c;
}

html[data-theme="light"] .header {
    background: linear-gradient(135deg, #4a6fa5 0%, #2a5298 100%);
    border-bottom: 2px solid #1e3a6e;
}

html[data-theme="light"] .live-ticker-bar,
html[data-theme="light"] [class*="live-ticker"] {
    background: linear-gradient(135deg, #4a6fa5 0%, #2a5298 100%) !important;
}

html[data-theme="light"] .tabs {
    background: #e2e8f0;
    border-bottom: 3px solid #cbd5e0;
}

html[data-theme="light"] .tab {
    background: #a0aec0;
    color: #2d3748;
    box-shadow: 0 3px 0 #a0aec0, 0 6px 12px rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .tab:hover {
    background: #718096;
    color: #fff;
}

html[data-theme="light"] .tab.active {
    background: linear-gradient(135deg, #ff8c00 0%, #ff4500 100%);
    color: #fff;
}

html[data-theme="light"] .tab-content {
    background: #ffffff;
    color: #1a202c;
}

html[data-theme="light"] .status-bar {
    background: #edf2f7;
    border: 1px solid #e2e8f0;
}

html[data-theme="light"] .ticker-section {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

html[data-theme="light"] .ticker-section:hover {
    border-color: #2a5298;
    box-shadow: 0 4px 12px rgba(42, 82, 152, 0.08);
}

html[data-theme="light"] .ticker-title {
    color: #2a5298;
}

html[data-theme="light"] .stat-value,
html[data-theme="light"] .detail-value {
    color: #1a202c;
}

html[data-theme="light"] .stat-label,
html[data-theme="light"] .detail-label {
    color: #718096;
}

html[data-theme="light"] .logs-container {
    background: #f7fafc;
    color: #2d3748;
    border: 1px solid #e2e8f0;
}

html[data-theme="light"] .log-entry {
    border-bottom: 1px solid #e2e8f0;
}

html[data-theme="light"] .settings-section,
html[data-theme="light"] .config-section {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

html[data-theme="light"] .position-card,
html[data-theme="light"] .positions-container {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

html[data-theme="light"] th {
    background: #edf2f7;
    color: #2d3748;
}

html[data-theme="light"] td {
    color: #4a5568;
    border-bottom: 1px solid #e2e8f0;
}

html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="date"],
html[data-theme="light"] select,
html[data-theme="light"] textarea {
    background: #ffffff;
    color: #1a202c;
    border: 1px solid #e2e8f0;
}

html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5 {
    color: #1a202c;
}

html[data-theme="light"] body::before {
    opacity: 0.02;
    mix-blend-mode: normal;
}

html[data-theme="light"] .btn-3d {
    background: #a0aec0;
    color: #2d3748;
    box-shadow: 0 4px 0 #718096, 0 8px 15px rgba(0, 0, 0, 0.1);
}