:root {
    /* Ocean Depths Palette */
    --clr-bg: #0A1628;
    --clr-panel: #112240;
    --clr-panel-hover: #1A365D;
    
    --clr-primary: #0984E3;
    --clr-secondary: #74B9FF;
    --clr-accent: #00CEC9;
    
    --clr-text: #E2E8F0;
    --clr-text-muted: #94A3B8;
    
    --clr-success: #10B981;
    --clr-warning: #F59E0B;
    --clr-danger: #EF4444;
    
    --clr-border: rgba(116, 185, 255, 0.15);
    --clr-glass: rgba(17, 34, 64, 0.7);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: all 0.25s ease;
}

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

body {
    background-color: var(--clr-bg);
    color: var(--clr-text);
    font-family: var(--font-sans);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

/* Utilities */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-muted { color: var(--clr-text-muted); }
.text-primary { color: var(--clr-primary); }
.text-secondary { color: var(--clr-secondary); }
.text-warning { color: var(--clr-warning); }
.text-danger { color: var(--clr-danger); }
.text-success { color: var(--clr-success); }

/* Buttons & Inputs */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
    color: white;
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 0 15px rgba(0, 206, 201, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(116, 185, 255, 0.1);
    color: var(--clr-secondary);
    border: 1px solid var(--clr-border);
}
.btn-secondary:hover:not(:disabled) {
    background: rgba(116, 185, 255, 0.2);
}

.search-input {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--clr-border);
    color: var(--clr-text);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    outline: none;
    transition: var(--transition);
    width: 250px;
}
.search-input:focus {
    border-color: var(--clr-secondary);
    box-shadow: 0 0 0 2px rgba(116,185,255,0.2);
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--clr-panel);
    border-right: 1px solid var(--clr-border);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--clr-border);
}
.brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--clr-accent), var(--clr-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-menu {
    flex-grow: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 0.75rem 1.5rem;
    color: var(--clr-text-muted);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.nav-item:hover {
    color: var(--clr-text);
    background: rgba(255,255,255,0.03);
}
.nav-item.active {
    color: var(--clr-accent);
    background: rgba(0, 206, 201, 0.1);
    border-left-color: var(--clr-accent);
    font-weight: 500;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--clr-border);
}

/* Main Content */
.content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: radial-gradient(circle at top right, #0F203C 0%, var(--clr-bg) 60%);
}

.topbar {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--clr-border);
    background: rgba(10, 22, 40, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 5;
}

.scroll-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem;
}

/* Panels & Glassmorphism */
.panel {
    background: var(--clr-panel);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--clr-border);
}
.glass-panel {
    background: var(--clr-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-glass);
}

/* Upload Dropzone */
.drop-zone {
    border: 2px dashed var(--clr-border);
    border-radius: var(--radius-md);
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,0.2);
}
.drop-zone.dragover {
    border-color: var(--clr-accent);
    background: rgba(0, 206, 201, 0.05);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--clr-text-muted);
    font-size: 0.8rem;
    width: 60%;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--clr-border);
}
.divider span { padding: 0 10px; }

.paste-area-wrapper { width: 100%; max-width: 600px; display: flex; flex-direction: column; align-items: center; }
.input-area {
    width: 100%;
    height: 120px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--clr-border);
    color: var(--clr-text);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-family: monospace;
    resize: vertical;
    outline: none;
    transition: var(--transition);
}
.input-area:focus { border-color: var(--clr-secondary); }

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 206, 201, 0.2);
    border-radius: 50%;
    border-top-color: var(--clr-accent);
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Dashboard Scores */
.score-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1.5rem;
}

.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(var(--clr-accent) 0%, rgba(9, 132, 227, 0.2) 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto;
    position: relative;
    border: 2px solid var(--clr-panel);
}
.score-circle::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--clr-panel);
    z-index: 1;
}
.score-circle span {
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, #fff, var(--clr-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

/* Charts */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.chart-wrapper {
    position: relative;
    height: 250px;
    width: 100%;
}

/* Data Tables */
.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--clr-border);
    color: var(--clr-text-muted);
    font-weight: 500;
}
.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(116, 185, 255, 0.05);
}
.data-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--clr-success); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--clr-warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--clr-danger); border: 1px solid rgba(239, 68, 68, 0.3); }

/* Smells & Hotspots List */
.smells-list, .hotspot-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.smell-item, .hotspot-item {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--clr-border);
    border-left: 4px solid var(--clr-warning);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
}
.smell-item.high, .hotspot-item.high { border-left-color: var(--clr-danger); }
.smell-item.low, .hotspot-item.low { border-left-color: var(--clr-primary); }

.code-snippet {
    background: #000;
    padding: 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--clr-secondary);
    display: inline-block;
    margin-top: 0.5rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--clr-panel);
    border: 1px solid var(--clr-border);
    color: var(--clr-text);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(116, 185, 255, 0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(116, 185, 255, 0.4); }

@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--clr-border); flex-direction: row; flex-wrap: wrap; }
    .brand { border-bottom: none; border-right: 1px solid var(--clr-border); }
    .nav-menu { flex-direction: row; overflow-x: auto; padding: 0.5rem; }
    .nav-item { width: auto; border-left: none; border-bottom: 3px solid transparent; padding: 0.5rem 1rem; }
    .nav-item.active { border-left-color: transparent; border-bottom-color: var(--clr-accent); }
    .sidebar-footer { border-top: none; padding: 0.5rem 1rem; margin-left: auto; }
    
    .score-grid { grid-template-columns: 1fr 1fr; }
    .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .score-grid { grid-template-columns: 1fr; }
}
