/* 
================================================================================
  QUANTUMEDGE STYLE SYSTEM (VANILLA CSS)
  Premium Dark Cyber / Glassmorphism Theme for Quantitative Trading
================================================================================
*/

:root {
    --bg-main: #060913;
    --bg-sidebar: rgba(10, 15, 30, 0.6);
    --bg-card: rgba(16, 24, 48, 0.35);
    --bg-card-hover: rgba(24, 36, 72, 0.5);
    
    --border-glass: rgba(255, 255, 255, 0.06);
    --border-glass-focus: rgba(0, 240, 255, 0.35);
    
    --color-text: #e2e8f0;
    --color-text-muted: #64748b;
    
    --accent-cyan: #00f0ff;
    --accent-cyan-glow: rgba(0, 240, 255, 0.25);
    
    --color-positive: #00ff88;
    --color-positive-glow: rgba(0, 255, 136, 0.2);
    
    --color-negative: #ff3b69;
    --color-negative-glow: rgba(255, 59, 105, 0.2);
    
    --color-warning: #ffb300;
    
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 15px var(--accent-cyan-glow);
}

/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 240, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(255, 59, 105, 0.04) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--color-text);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* APP CONTAINER & HEADER */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 0;
}

.app-header {
    height: 70px;
    background: rgba(6, 9, 19, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo h1 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #ffffff;
}

.header-logo h1 span {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.glowing-dot {
    width: 10px;
    height: 10px;
    background-color: var(--color-positive);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--color-positive);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(0, 255, 136, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

.badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-muted);
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
    font-weight: 600;
}

.header-status {
    display: flex;
    gap: 24px;
}

.status-item {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-item .label {
    color: var(--color-text-muted);
    font-weight: 500;
}

.status-item .value {
    color: #ffffff;
    font-weight: 600;
}

.status-item .value.ready {
    color: var(--accent-cyan);
    text-shadow: 0 0 8px var(--accent-cyan-glow);
}

.status-item .value.running {
    color: var(--color-positive);
    text-shadow: 0 0 8px var(--color-positive-glow);
}

/* LAYOUT */
.app-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* SIDEBAR CONTROLS */
.app-sidebar {
    width: 320px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-glass);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-y: auto;
}

.sidebar-section h2 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 12px;
}

select {
    width: 100%;
    background: rgba(16, 24, 48, 0.8);
    border: 1px solid var(--border-glass);
    color: var(--color-text);
    padding: 12px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

select:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.input-group {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 11px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.text-input {
    width: 100%;
    background: rgba(16, 24, 48, 0.8);
    border: 1px solid var(--border-glass);
    color: var(--color-text);
    padding: 10px 12px;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
}

.text-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.text-input.uppercase {
    text-transform: uppercase;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: var(--font-body);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), #00a8ff);
    color: #060913;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.control-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

#btn-generate-market {
    width: 100%;
}

.slider-group {
    margin-top: 15px;
}

.slider-group label {
    display: block;
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

/* Custom Range Input */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    height: 6px;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-cyan);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-cyan);
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--color-text-muted);
    margin-top: 5px;
}

.strategy-params {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hidden {
    display: none !important;
}

/* WORKSPACE */
.app-workspace {
    flex: 1;
    background: transparent;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    overflow-y: auto;
}

/* METRICS GRID */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.metric-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-premium);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    border-color: var(--border-glass-focus);
    box-shadow: var(--shadow-glow);
}

.metric-card .title {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    letter-spacing: 0.8px;
}

.metric-card .value {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
}

.metric-card .value.positive {
    color: var(--color-positive);
    text-shadow: 0 0 10px var(--color-positive-glow);
}

.metric-card .value.negative {
    color: var(--color-negative);
    text-shadow: 0 0 10px var(--color-negative-glow);
}

.metric-card .sub {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* STATUS SUBPANEL */
.status-panel {
    background: rgba(16, 24, 48, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-col .label {
    font-size: 11px;
    color: var(--color-text-muted);
    font-weight: 500;
}

.status-col .value {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.status-col .value.positive {
    color: var(--color-positive);
}

.status-col .value.negative {
    color: var(--color-negative);
}

/* CHARTS REGION */
.charts-region {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chart-container h3 {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 220px;
}

.main-chart .canvas-wrapper {
    min-height: 320px;
}

.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* RESPONSIVENESS */
@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .chart-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
        overflow-y: auto;
    }
    .app-sidebar {
        width: 100%;
        height: auto;
        overflow-y: visible;
    }
    .app-workspace {
        overflow-y: visible;
    }
}

/* SECURE CREDENTIALS BADGE */
.secure-badge {
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.25);
    border-radius: 8px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.05);
    animation: glow-secure 3s infinite alternate;
}

@keyframes glow-secure {
    0% { border-color: rgba(0, 255, 136, 0.2); box-shadow: 0 0 10px rgba(0, 255, 136, 0.03); }
    100% { border-color: rgba(0, 255, 136, 0.4); box-shadow: 0 0 20px rgba(0, 255, 136, 0.12); }
}

.secure-icon {
    font-size: 20px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

.secure-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.secure-title {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    color: var(--color-positive);
    letter-spacing: 1px;
}

.secure-sub {
    font-size: 11px;
    color: var(--color-text-muted);
}
