@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #0b0f19;
    --secondary: #111827;
    --tertiary: #3b82f6;
    --tertiary-glow: rgba(59, 130, 246, 0.5);
    --neutral: #f8fafc;
    --on-neutral: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --glass-bg: rgba(17, 24, 39, 0.7);
    --glass-hover: rgba(31, 41, 55, 0.85);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--primary);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.1), transparent 25%);
    background-attachment: fixed;
    color: var(--neutral);
    min-height: 100vh;
    font-size: 0.875rem;
    line-height: 1.5;
}

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

h1, h2, h3 { font-weight: 600; color: var(--neutral); }
h1 { font-size: 2rem; letter-spacing: -0.03em; font-weight: 700; background: linear-gradient(to right, #fff, #94a3b8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
h3 { font-size: 1.1rem; }

.text-danger { color: var(--danger) !important; }

/* Components: Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
    border-color: var(--glass-border-hover);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255,255,255,0.1);
}

/* Layout */
.dashboard-wrapper { display: flex; min-height: 100vh; max-width: 1600px; margin: 0 auto; }
.sidebar { width: 280px; padding: 32px 24px; display: flex; flex-direction: column; margin: 24px; height: calc(100vh - 48px); position: sticky; top: 24px; }
.logo { display: flex; align-items: center; gap: 16px; margin-bottom: 48px; }
.logo h2 { font-size: 1.5rem; letter-spacing: -0.02em; }
.nav-links { list-style: none; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.nav-links li a { text-decoration: none; color: var(--on-neutral); font-weight: 500; padding: 14px 20px; border-radius: 12px; display: block; transition: all 0.3s; position: relative; overflow: hidden; }
.nav-links li.active a, .nav-links li a:hover { background: rgba(59, 130, 246, 0.1); color: var(--tertiary); }
.nav-links li.active a::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tertiary); border-radius: 0 4px 4px 0; }
.main-content { flex: 1; padding: 24px 32px 24px 8px; }
.top-header { margin-bottom: 40px; padding-top: 8px; }
.server-info { color: var(--on-neutral); margin-top: 12px; font-size: 1rem; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.db-status { margin-top: 12px; padding: 6px 12px; border-radius: 9999px; font-size: 0.8rem; font-weight: 700; border: 1px solid rgba(148, 163, 184, 0.25); color: var(--on-neutral); background: rgba(148, 163, 184, 0.1); }
.db-online { color: var(--success); border-color: rgba(16, 185, 129, 0.35); background: rgba(16, 185, 129, 0.12); }
.db-error { color: var(--danger); border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.12); }
.db-offline { color: var(--warning); border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.12); }

/* Grid */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 32px; }
.metric-card { padding: 28px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.metric-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent); }
.metric-card:hover { transform: translateY(-4px); background: var(--glass-hover); }

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.badge { background: rgba(59, 130, 246, 0.15); color: #60a5fa; padding: 6px 14px; border-radius: 9999px; font-size: 0.8rem; font-weight: 600; border: 1px solid rgba(59,130,246,0.3); }
.chart-container { position: relative; height: 180px; width: 100%; margin-bottom: 20px; }
.metric-footer { margin-top: auto; color: var(--on-neutral); text-align: center; font-weight: 500; padding-top: 20px; border-top: 1px solid var(--glass-border); font-size: 0.95rem; }

/* Storage Progress Bar */
.storage-info { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 10px 0; }
.progress-bar { width: 100%; height: 16px; background: rgba(0,0,0,0.4); border-radius: 9999px; overflow: hidden; margin-bottom: 16px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.5); }
.progress-fill { height: 100%; background: linear-gradient(90deg, #2563eb, #3b82f6); transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 9999px; position: relative; }
.progress-fill::after { content: ''; position: absolute; top: 0; left: 0; bottom: 0; right: 0; background: linear-gradient(rgba(255,255,255,0.2), transparent); border-radius: 9999px; }
.storage-details { color: var(--on-neutral); text-align: center; font-size: 1rem; }
.mt-2 { margin-top: 12px; }

/* Lists */
.list-card { grid-column: 1 / -1; }
.container-list ul { list-style: none; }
.container-list li { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--glass-border); transition: background 0.2s; border-radius: 8px; }
.container-list li:hover { background: rgba(255,255,255,0.02); padding-left: 12px; padding-right: 12px; margin: 0 -12px; }
.container-list li:last-child { border-bottom: none; padding-bottom: 0; }
.c-name { font-weight: 500; flex: 1; display: flex; align-items: center; font-size: 1.05rem; }
.c-stats { display: flex; gap: 32px; color: var(--on-neutral); font-variant-numeric: tabular-nums; }
.c-state { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 16px; box-shadow: 0 0 8px currentColor; }
.c-state.running { background: var(--success); color: var(--success); }
.c-state.exited { background: var(--danger); color: var(--danger); }
.docker-error { color: var(--danger); }

/* Terminal Logs */
.log-card { grid-column: 1 / -1; }
.terminal-container { background: #050505; border-radius: 12px; padding: 24px; height: 350px; overflow-y: auto; font-family: 'JetBrains Mono', 'Fira Code', monospace; color: #a3be8c; font-size: 0.9rem; line-height: 1.6; border: 1px solid rgba(255,255,255,0.1); box-shadow: inset 0 0 20px rgba(0,0,0,0.8); }
.log-line { margin-bottom: 6px; word-wrap: break-word; }
.log-error { color: #bf616a; }
.log-actions { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--success); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* Pulses */
.pulse-ring { width: 14px; height: 14px; background: var(--tertiary); border-radius: 50%; box-shadow: 0 0 0 0 var(--tertiary-glow); animation: pulse 2s infinite; }
.green-ring { background: var(--success); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@media (max-width: 1024px) {
    .dashboard-wrapper { flex-direction: column; }
    .sidebar { width: auto; height: auto; position: relative; margin: 16px; padding: 24px; }
    .main-content { padding: 16px; }
    .metrics-grid { grid-template-columns: 1fr; }
}

/* Login Page Styles */
.login-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; position: relative; overflow: hidden; }
.login-body::before { content: ''; position: absolute; width: 600px; height: 600px; background: radial-gradient(circle, var(--tertiary-glow), transparent 70%); top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0.5; z-index: -1; }
.login-container { padding: 48px; width: 100%; max-width: 440px; text-align: center; }
.login-header h2 { font-size: 2.2rem; margin-bottom: 12px; color: #fff; letter-spacing: -0.03em; }
.login-header p { color: var(--on-neutral); font-size: 1rem; margin-bottom: 40px; }
.input-group { margin-bottom: 24px; }
.input-group input { width: 100%; padding: 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); background: rgba(0, 0, 0, 0.3); color: white; font-size: 1.05rem; outline: none; transition: all 0.3s; box-shadow: inset 0 2px 4px rgba(0,0,0,0.2); }
.input-group input:focus { border-color: var(--tertiary); box-shadow: 0 0 0 3px rgba(59,130,246,0.2), inset 0 2px 4px rgba(0,0,0,0.2); background: rgba(0,0,0,0.5); }
.btn-primary { width: 100%; padding: 16px; border: none; border-radius: 12px; background: linear-gradient(135deg, var(--tertiary), #2563eb); color: white; font-size: 1.1rem; font-weight: 600; cursor: pointer; transition: all 0.3s; box-shadow: 0 4px 12px rgba(59,130,246,0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(59,130,246,0.4); }
.btn-primary:active { transform: translateY(0); }
.error-text { color: var(--danger); margin-top: 20px; font-size: 0.95rem; background: rgba(239, 68, 68, 0.1); padding: 10px; border-radius: 8px; border: 1px solid rgba(239, 68, 68, 0.2); }
