:root {
    --bg-dark: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-primary: #8b5cf6;
    --accent-secondary: #06b6d4;
}

body.light-theme {
    --bg-dark: #f1f5f9;
    --panel-bg: rgba(255, 255, 255, 0.7);
    --border-color: rgba(0, 0, 0, 0.1);
    --text-main: #0f172a;
    --text-muted: #475569;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(124, 58, 237, 0.1), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(8, 145, 178, 0.1), transparent 25%);
}
body.light-theme .glass-panel { box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05); }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.15), transparent 25%);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* UTILITIES */
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 1rem; }
.p-1\.5 { padding: 1.5rem; }
.p-2 { padding: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.ml-auto { margin-left: auto; }
.span-2-col { grid-column: span 2; }
.accent-text { color: var(--accent-primary); }
.btn-primary { 
    background: var(--accent-primary); color: white; border: none; padding: 8px 16px; 
    border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 500; 
}
.btn-primary:hover { filter: brightness(1.1); }

/* LAYOUT */
.app-container { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px; background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-color); padding: 2rem 1rem; display: flex; flex-direction: column;
}
.logo {
    display: flex; align-items: center; gap: 12px; font-size: 1.5rem; font-weight: 700;
    margin-bottom: 3rem; padding-left: 1rem;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-links { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.nav-links li {
    display: flex; align-items: center; gap: 12px; padding: 1rem; border-radius: 12px;
    cursor: pointer; color: var(--text-muted); transition: all 0.3s ease; font-weight: 500;
}
.nav-links li:hover, .nav-links li.active { background: rgba(255, 255, 255, 0.05); color: var(--text-main); }
.nav-links li.active { box-shadow: inset 3px 0 0 var(--accent-primary); }

.main-content { flex: 1; padding: 2rem; display: flex; flex-direction: column; gap: 2rem; }
header { display: flex; justify-content: space-between; align-items: center; }
header h1 { font-size: 1.8rem; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 1.5rem; }
.search-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 20px; }
.search-bar i { color: var(--text-muted); width: 18px; }
.search-bar input { background: transparent; border: none; color: var(--text-main); font-family: inherit; outline: none; width: 220px; }
.user-profile img { width: 45px; height: 45px; border-radius: 50%; border: 2px solid var(--accent-primary); }

.glass-panel {
    background: var(--panel-bg); backdrop-filter: blur(16px);
    border: 1px solid var(--border-color); border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* CHARTS & STATS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.stat-card { padding: 1.5rem; display: flex; align-items: center; gap: 1rem; transition: transform 0.2s ease; }
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(139, 92, 246, 0.1); }
.stat-icon { background: rgba(255, 255, 255, 0.05); padding: 1rem; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--accent-primary); }
.stat-details h3 { font-size: 0.9rem; color: var(--text-muted); font-weight: 400; margin-bottom: 4px; }
.stat-details p { font-size: 1.5rem; font-weight: 700; }

.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.chart-container { padding: 1.5rem; display: flex; flex-direction: column; }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.chart-header h2 { font-size: 1.2rem; }
.export-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; transition: color 0.2s; }
.export-btn:hover { color: var(--accent-primary); }

/* DEG TABLE */
.table-panel { padding: 2rem; overflow: hidden; }
.table-responsive { overflow-x: auto; margin-top: 1rem; max-height: 600px; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th, .data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border-color); }
.data-table th { font-weight: 600; color: var(--text-muted); position: sticky; top: 0; background: var(--panel-bg); z-index: 10; }
.data-table tr:hover { background: rgba(255,255,255,0.02); }
.sig-up { color: #10b981; } .sig-down { color: #ef4444; }

/* PROTEIN VIZ */
.custom-grid-protein { grid-template-columns: 2fr 1fr; }
.metric-list { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-top: 1rem; }
.metric-list li { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--border-color); padding-bottom: 8px; }
.badge.success { background: rgba(16, 185, 129, 0.2); color: #10b981; padding: 2px 8px; border-radius: 12px; font-size: 0.8rem; }
.sec-struct-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: rgba(255,255,255,0.1); }
.sec-struct-bar .helix { background: #8b5cf6; }
.sec-struct-bar .sheet { background: #06b6d4; }
.sec-struct-bar .coil { background: #94a3b8; }

/* GENE INTEL */
.intel-search input { width: 100%; flex: 1; }
.intel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.intel-card { background: rgba(0,0,0,0.1); padding: 1.5rem; border-radius: 12px; border: 1px solid var(--border-color); }
.intel-card h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 1rem; color: var(--text-main); }
.intel-card p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }
.db-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1rem; }
.db-btn { text-decoration: none; padding: 8px 16px; border-radius: 20px; background: rgba(255,255,255,0.05); color: var(--text-main); border: 1px solid var(--border-color); transition: all 0.2s; font-size: 0.9rem; }
.db-btn:hover { background: var(--accent-primary); border-color: var(--accent-primary); }

/* SETTINGS */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.setting-item { display: flex; justify-content: space-between; align-items: center; margin-top: 1.2rem; }
.setting-item label { color: var(--text-muted); }
.custom-select, .custom-input { background: rgba(0,0,0,0.2); border: 1px solid var(--border-color); color: var(--text-main); padding: 0.5rem 1rem; border-radius: 8px; font-family: inherit; outline: none; }
input[type="color"] { background: none; border: none; width: 40px; height: 40px; cursor: pointer; border-radius: 8px; }
input[type=range] { -webkit-appearance: none; background: rgba(255,255,255,0.1); height: 6px; border-radius: 3px; outline: none; width: 150px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-primary); cursor: pointer; }
.switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-primary); }
input:checked + .slider:before { transform: translateX(24px); }
