/* Labb Uptime - Modern Dark Theme */
:root {
    --bg-primary: #0a0a0b;
    --bg-secondary: #111113;
    --bg-tertiary: #18181b;
    --bg-card: #1c1c1f;
    --bg-hover: #27272a;
    --border-color: #27272a;
    --border-subtle: #1f1f22;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --accent-green: #22c55e;
    --accent-green-dim: rgba(34, 197, 94, 0.15);
    --accent-red: #ef4444;
    --accent-red-dim: rgba(239, 68, 68, 0.15);
    --accent-yellow: #eab308;
    --accent-yellow-dim: rgba(234, 179, 8, 0.15);
    --accent-blue: #3b82f6;
    --accent-blue-dim: rgba(59, 130, 246, 0.15);
    --accent-purple: #a855f7;
    --sidebar-width: 240px;
    --topbar-height: 60px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform 0.2s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.logo-icon {
    color: var(--accent-green);
    font-size: 1.4rem;
}

.sidebar-close { display: none; background: none; border: none; color: var(--text-secondary); padding: 8px; }

.nav-section { padding: 12px; flex: 1; }
.nav-section-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); padding: 8px 12px; margin-top: 12px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.15s ease;
    margin-bottom: 2px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-green-dim); color: var(--accent-green); }
.nav-item svg { width: 18px; height: 18px; }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border-color); }
.logout-btn:hover { background: var(--accent-red-dim); color: var(--accent-red); }

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-bar {
    height: var(--topbar-height);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle { display: none; background: none; border: none; color: var(--text-secondary); padding: 8px; margin-right: 12px; }
.page-title { font-size: 1.1rem; font-weight: 600; }
.top-bar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.user-name { font-size: 0.85rem; color: var(--text-secondary); }

.content-area { padding: 24px; flex: 1; }

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; }
.alert-success { background: var(--accent-green-dim); color: var(--accent-green); }
.alert-error { background: var(--accent-red-dim); color: var(--accent-red); }
.alert-warning { background: var(--accent-yellow-dim); color: var(--accent-yellow); }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 0.9rem; font-weight: 600; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.stat-value { font-size: 2rem; font-weight: 700; font-family: var(--font-mono); }
.stat-value.up { color: var(--accent-green); }
.stat-value.down { color: var(--accent-red); }
.stat-value.paused { color: var(--accent-yellow); }

/* Monitor List */
.monitor-list { display: flex; flex-direction: column; gap: 8px; }

.monitor-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.monitor-item:hover { border-color: var(--text-muted); }
.monitor-item.down { border-left: 3px solid var(--accent-red); }
.monitor-item.up { border-left: 3px solid var(--accent-green); }
.monitor-item.paused { border-left: 3px solid var(--accent-yellow); }

.monitor-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.monitor-status.up { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }
.monitor-status.down { background: var(--accent-red); box-shadow: 0 0 8px var(--accent-red); animation: pulse 2s infinite; }
.monitor-status.paused { background: var(--accent-yellow); }
.monitor-status.pending { background: var(--text-muted); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.monitor-info { flex: 1; min-width: 0; }
.monitor-name { font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.monitor-url { font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.monitor-meta { display: flex; gap: 24px; align-items: center; }
.meta-item { text-align: right; }
.meta-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
.meta-value { font-size: 0.9rem; font-family: var(--font-mono); }
.meta-value.fast { color: var(--accent-green); }
.meta-value.slow { color: var(--accent-yellow); }
.meta-value.error { color: var(--accent-red); }

/* 24-Hour Status Bar */
.status-bar-24h {
    display: flex;
    gap: 2px;
    height: 24px;
    margin: 16px 0;
}

.status-bar-hour {
    flex: 1;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.1s ease;
    position: relative;
}

.status-bar-hour:hover { transform: scaleY(1.2); }
.status-bar-hour.up { background: var(--accent-green); }
.status-bar-hour.down { background: var(--accent-red); }
.status-bar-hour.degraded { background: var(--accent-yellow); }
.status-bar-hour.no-data { background: var(--bg-hover); }

.status-bar-hour:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 4px;
}

/* Response Time Chart */
.chart-container { height: 200px; margin: 16px 0; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent-green); color: #000; }
.btn-primary:hover { background: #16a34a; }
.btn-secondary { background: var(--bg-hover); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { border-color: var(--text-muted); }
.btn-danger { background: var(--accent-red-dim); color: var(--accent-red); }
.btn-danger:hover { background: var(--accent-red); color: #fff; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; color: var(--text-secondary); }
.form-input, .form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
}
.form-input:focus, .form-select:focus { outline: none; border-color: var(--accent-green); }
.form-input::placeholder { color: var(--text-muted); }

/* Tables */
.table-container { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-color); }
.table th { font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); font-weight: 500; }
.table tbody tr:hover { background: var(--bg-hover); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-success { background: var(--accent-green-dim); color: var(--accent-green); }
.badge-danger { background: var(--accent-red-dim); color: var(--accent-red); }
.badge-warning { background: var(--accent-yellow-dim); color: var(--accent-yellow); }
.badge-info { background: var(--accent-blue-dim); color: var(--accent-blue); }
.badge-secondary { background: var(--bg-hover); color: var(--text-secondary); }

/* Incidents */
.incident-list { display: flex; flex-direction: column; gap: 8px; }
.incident-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-red);
}
.incident-item.resolved { border-left-color: var(--accent-green); opacity: 0.7; }
.incident-icon { color: var(--accent-red); }
.incident-item.resolved .incident-icon { color: var(--accent-green); }
.incident-info { flex: 1; }
.incident-title { font-weight: 500; font-size: 0.9rem; }
.incident-time { font-size: 0.8rem; color: var(--text-muted); }
.incident-duration { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-secondary); }

/* SSL/Domain Expiry */
.expiry-info {
    display: flex;
    gap: 24px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-top: 16px;
}

.expiry-item { flex: 1; }
.expiry-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.expiry-value { font-family: var(--font-mono); }
.expiry-value.danger { color: var(--accent-red); }
.expiry-value.warning { color: var(--accent-yellow); }
.expiry-value.success { color: var(--accent-green); }

/* Empty States */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-size: 1.1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .sidebar-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 99; display: none; }
    .sidebar-overlay.active { display: block; }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .top-bar { padding: 0 16px; }
    .content-area { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .stat-value { font-size: 1.5rem; }
    .monitor-meta { display: none; }
    .monitor-item { padding: 12px; }
    .expiry-info { flex-direction: column; gap: 12px; }
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-primary);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-icon { font-size: 2.5rem; }
.auth-logo .logo-text { font-size: 1.5rem; font-weight: 700; margin-top: 8px; display: block; }

.auth-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 8px; text-align: center; }
.auth-subtitle { color: var(--text-muted); font-size: 0.9rem; text-align: center; margin-bottom: 32px; }

.auth-form .form-group { margin-bottom: 16px; }
.auth-form .btn { width: 100%; justify-content: center; margin-top: 8px; }

.auth-footer { text-align: center; margin-top: 24px; font-size: 0.85rem; color: var(--text-muted); }

.email-sent-message {
    text-align: center;
    padding: 24px;
}
.email-sent-message svg { width: 64px; height: 64px; color: var(--accent-green); margin-bottom: 16px; }

/* Grid Layout Helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

/* Uptime Percentage */
.uptime-display {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    padding: 24px;
}
.uptime-display.excellent { color: var(--accent-green); }
.uptime-display.good { color: var(--accent-yellow); }
.uptime-display.poor { color: var(--accent-red); }

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
