/* ==============================
   STRATEGIES DASHBOARD - CSS
   ============================== */

:root {
    --st-bg: #070c18;
    --st-bg-card: rgba(13, 20, 40, 0.85);
    --st-bg-card-2: rgba(18, 28, 55, 0.6);
    --st-sidebar-bg: rgba(6, 10, 22, 0.95);
    --st-accent: #00c853;
    --st-accent-glow: rgba(0, 200, 83, 0.2);
    --st-accent-blue: #448aff;
    --st-accent-yellow: #ffd740;
    --st-accent-red: #ff5252;
    --st-accent-purple: #b388ff;
    --st-text-1: #f1f5f9;
    --st-text-2: #94a3b8;
    --st-text-3: #475569;
    --st-border: rgba(255, 255, 255, 0.07);
    --st-border-hover: rgba(255, 255, 255, 0.15);
    --st-shadow-card: 0 4px 20px rgba(0, 0, 0, 0.5);
    --st-sidebar-w: 240px;
    --st-radius: 12px;
    --st-radius-sm: 8px;
}

/* ===== LAYOUT ===== */
.st-app-layout {
    display: grid;
    grid-template-columns: var(--st-sidebar-w) 1fr;
    min-height: calc(100vh - 60px);
    width: 100%;
    background: var(--st-bg);
    background-image:
        radial-gradient(ellipse at 15% 20%, rgba(0, 200, 83, 0.05) 0, transparent 55%),
        radial-gradient(ellipse at 85% 80%, rgba(68, 138, 255, 0.05) 0, transparent 55%);
}

/* ===== SIDEBAR ===== */
.st-sidebar {
    background: var(--st-sidebar-bg);
    border-right: 1px solid var(--st-border);
    display: flex;
    flex-direction: column;
    padding: 0;
    position: sticky;
    top: 0;
    height: calc(100vh - 60px);
    overflow-y: auto;
    backdrop-filter: blur(20px);
}

.st-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--st-border);
}

.st-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--st-accent), #009624);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}

.st-brand-text .brand-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--st-text-1);
    display: block;
}

.st-brand-text .brand-sub {
    font-size: 11px;
    color: var(--st-text-2);
    display: block;
}

.st-sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 12px 8px;
    gap: 2px;
}

.st-sidebar-nav .nav-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--st-text-3);
    padding: 8px 12px 4px;
}

.st-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--st-radius-sm);
    color: var(--st-text-2);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.st-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--st-text-1);
}

.st-nav-item.active {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.15), rgba(0, 200, 83, 0.05));
    color: var(--st-accent);
    font-weight: 600;
}

.st-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ===== MAIN CONTENT ===== */
.st-main {
    padding: 24px 28px;
    overflow-y: auto;
    height: calc(100vh - 60px);
}

.st-page {
    display: none;
}

.st-page.active {
    display: block;
}

/* ===== HEADER ===== */
.st-page-header {
    margin-bottom: 24px;
}

.st-page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--st-text-1);
    margin: 0;
}

.st-page-header .st-subtitle {
    font-size: 13px;
    color: var(--st-text-2);
    margin-top: 4px;
}

/* ===== METRIC CARDS ===== */
.st-metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.st-metric-card {
    background: var(--st-bg-card);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 16px 20px;
    border-left: 4px solid var(--st-accent);
    box-shadow: var(--st-shadow-card);
}

.st-metric-card.blue { border-left-color: var(--st-accent-blue); }
.st-metric-card.red { border-left-color: var(--st-accent-red); }
.st-metric-card.yellow { border-left-color: var(--st-accent-yellow); }
.st-metric-card.purple { border-left-color: var(--st-accent-purple); }

.st-metric-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--st-text-2);
    margin-bottom: 4px;
}

.st-metric-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--st-text-1);
}

.st-metric-sub {
    font-size: 11px;
    color: var(--st-text-3);
    margin-top: 2px;
}

/* ===== SECTION ===== */
.st-section {
    background: var(--st-bg-card);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--st-shadow-card);
}

.st-section-header {
    font-size: 15px;
    font-weight: 700;
    color: var(--st-accent-blue);
    border-bottom: 1px solid var(--st-border);
    padding-bottom: 10px;
    margin-bottom: 16px;
}

/* ===== TABLES ===== */
.st-table-wrap {
    overflow-x: auto;
}

.st-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.st-table th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--st-text-2);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--st-border);
    white-space: nowrap;
    cursor: pointer;
}

.st-table th:hover {
    color: var(--st-text-1);
}

.st-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s, background 0.2s;
}

.st-table th.sortable:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--st-accent);
}

.st-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--st-text-1);
    white-space: nowrap;
}

.st-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.st-table tr.reliable td {
    background: rgba(0, 200, 83, 0.05);
}

.st-table .positive { color: var(--st-accent); font-weight: 600; }
.st-table .negative { color: var(--st-accent-red); font-weight: 600; }
.st-table .neutral { color: var(--st-accent-yellow); }

/* ===== BADGES ===== */
.st-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.st-badge.reliable {
    background: var(--st-accent);
    color: #000;
}

.st-badge.other {
    background: #455a64;
    color: #ccc;
}

/* ===== FILTERS ===== */
.st-filters {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.st-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.st-filter-group label {
    font-size: 12px;
    color: var(--st-text-2);
    font-weight: 500;
}

.st-filter-group input[type="range"] {
    width: 120px;
    accent-color: var(--st-accent);
}

.st-filter-group input[type="checkbox"] {
    accent-color: var(--st-accent);
    width: 16px;
    height: 16px;
}

.st-filter-group select {
    background: var(--st-bg-card-2);
    color: var(--st-text-1);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius-sm);
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
}

.st-filter-group select:focus {
    outline: none;
    border-color: var(--st-accent);
}

/* ===== CHARTS ===== */
.st-chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.st-chart-box {
    background: var(--st-bg-card-2);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 16px;
    height: 320px;
}

.st-chart-box canvas {
    max-height: 280px !important;
}

.st-chart-box.full {
    grid-column: 1 / -1;
}

.st-chart-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--st-text-2);
    margin-bottom: 12px;
}

/* ===== STOCK SELECT ===== */
.st-stock-select-wrap {
    margin-bottom: 20px;
}

.st-stock-select-wrap select {
    background: var(--st-bg-card);
    color: var(--st-text-1);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius-sm);
    padding: 10px 16px;
    font-size: 14px;
    width: 300px;
    max-width: 100%;
    cursor: pointer;
}

.st-stock-select-wrap select:focus {
    outline: none;
    border-color: var(--st-accent);
}

/* ===== STRATEGY INFO ===== */
.st-info-card {
    background: var(--st-bg-card-2);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 20px 24px;
    margin-bottom: 16px;
}

.st-info-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--st-accent);
    margin-bottom: 12px;
}

.st-info-card p, .st-info-card li {
    font-size: 14px;
    color: var(--st-text-2);
    line-height: 1.7;
}

.st-info-card ul {
    padding-left: 20px;
}

.st-info-card .highlight {
    color: var(--st-accent);
    font-weight: 600;
}

.st-info-card .stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.st-info-card .stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--st-border);
}

.st-info-card .stat-label {
    color: var(--st-text-2);
    font-size: 13px;
}

.st-info-card .stat-value {
    color: var(--st-text-1);
    font-weight: 600;
    font-size: 13px;
}

/* ===== LOADING ===== */
.st-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--st-text-3);
    font-size: 14px;
}

.st-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--st-border);
    border-top-color: var(--st-accent);
    border-radius: 50%;
    animation: st-spin 0.8s linear infinite;
    margin-right: 10px;
}

@keyframes st-spin {
    to { transform: rotate(360deg); }
}

/* ===== EMPTY STATE ===== */
.st-empty {
    text-align: center;
    padding: 40px;
    color: var(--st-text-3);
    font-size: 14px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .st-app-layout {
        grid-template-columns: 1fr;
    }
    .st-sidebar {
        position: fixed;
        left: -260px;
        top: 60px;
        z-index: 1000;
        width: var(--st-sidebar-w);
        transition: left 0.3s;
    }
    .st-sidebar.open {
        left: 0;
    }
    .st-main {
        padding: 16px;
        height: auto;
    }
    .st-chart-row {
        grid-template-columns: 1fr;
    }
    .st-metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .st-mobile-toggle {
        display: block !important;
    }
}

.st-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--st-accent);
    color: #000;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 200, 83, 0.4);
}
