:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.dashboard-container {
    display: flex;
    width: 100%;
    max-width: 1600px;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: 250px;
    background: rgba(15, 23, 42, 0.95);
    border-right: var(--glass-border);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.logo h2 {
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -1px;
    margin-bottom: 40px;
}

.highlight {
    color: var(--accent-color);
}

nav button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 100%;
    padding: 12px 15px;
    text-align: left;
    cursor: pointer;
    font-size: 16px;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: 0.3s;
}

nav button:hover,
nav button.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
}

/* STOCK LIST STYLES */
.stock-list-container {
    margin: 20px 0;
    flex: 1;
    /* Take remaining height */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.stock-list-container h3 {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.stock-list {
    overflow-y: auto;
    padding-right: 5px;
    flex: 1;
}

/* Slim Scrollbar */
.stock-list::-webkit-scrollbar {
    width: 4px;
}

.stock-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.stock-list button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    width: 100%;
    padding: 10px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: 0.2s;
}

.stock-list button:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(59, 130, 246, 0.3);
    padding-left: 15px;
    /* Slide effect */
}

.market-status {
    /* margin-top: auto; removed auto to stick below list */
    background: rgba(16, 185, 129, 0.1);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.market-status p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.05), transparent 40%);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 10px;
    background: var(--card-bg);
    padding: 5px;
    border-radius: 10px;
    border: var(--glass-border);
}

.search-box input {
    background: transparent;
    border: none;
    padding: 10px 15px;
    color: white;
    width: 250px;
    outline: none;
}

.search-box button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.search-box button:hover {
    background: #2563eb;
}

.search-box button:disabled {
    background: #475569;
    cursor: not-allowed;
}

/* GRID LAYOUT UPDATE */
.grid-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    /* Left (Chart+Gauge) vs Right (Signals) */
    gap: 20px;
    height: calc(100vh - 120px);
}

.card {
    background: var(--card-bg);
    border: var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

/* CHART CARD */
.chart-card {
    /* Height handled inline for split */
}

.card-header h2 {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-header h1 {
    font-size: 42px;
    margin: 5px 0 20px 0;
}

/* SIGNAL CARD */
.signal-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.signal-item span {
    color: var(--text-secondary);
}

.final-decision {
    text-align: center;
    margin-top: 10px;
    padding: 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.final-decision h1 {
    font-size: 32px;
    color: var(--text-secondary);
    /* Default */
}

/* GAUGE CARD */
.gauge-container {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(var(--accent-color) 0%, rgba(255, 255, 255, 0.1) 0%);
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 1s ease-out;
}

.gauge-cover {
    width: 120px;
    height: 120px;
    background: #1e293b;
    /* Matches card inner */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
}

.ai-card p {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .grid-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .chart-card {
        grid-row: auto;
        height: 400px;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
        height: auto;
        overflow-y: visible;
    }

    .sidebar {
        width: 100%;
        padding: 15px;
    }

    .grid-container {
        height: auto;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
    }
}