/* UptimeBot — custom CSS layer (works alongside Tailwind Play CDN). */

:root {
    --bg-0:        #0a0a0b;
    --bg-1:        #111114;
    --bg-2:        #17171b;
    --bg-3:        #1d1d22;
    --border:      #2a2a30;
    --border-soft: #1f1f25;
    --text:        #e6e6e9;
    --text-muted:  #8b8b95;
    --text-dim:    #5f5f68;
    --accent:      #7c5cff;
    --accent-hov:  #8e72ff;
    --green:       #22c55e;
    --red:         #ef4444;
    --yellow:      #f59e0b;
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html, body {
    background: var(--bg-0);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* Custom scrollbar for the dark theme */
::-webkit-scrollbar       { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a40; }

/* ---- Status indicators ---- */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.up      { background: var(--green); box-shadow: 0 0 8px rgba(34,197,94,.5); }
.status-dot.down    { background: var(--red);   box-shadow: 0 0 8px rgba(239,68,68,.5); }
.status-dot.unknown { background: #525258; }
.status-dot.pulse   { animation: pulse 1.5s infinite; }

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

/* ---- 90-day timeline bar ---- */
.timeline {
    display: flex;
    gap: 2px;
    align-items: stretch;
    height: 28px;
}
.timeline .tick {
    flex: 1;
    min-width: 2px;
    background: var(--bg-3);
    border-radius: 2px;
    transition: transform .12s ease;
    cursor: default;
}
.timeline .tick:hover { transform: scaleY(1.15); }
.timeline .tick.up   { background: var(--green); }
.timeline .tick.down { background: var(--red); }
.timeline .tick.partial { background: var(--yellow); }
.timeline .tick.none    { background: var(--bg-3); }

/* Sparkline timeline (smaller variant in monitor rows) */
.timeline.sm { height: 20px; gap: 1px; }
.timeline.sm .tick { border-radius: 1px; }

/* ---- Cards & shells ---- */
.card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.card-elev {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
}

/* ---- Sidebar nav links ---- */
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 14px;
    transition: all .15s;
    text-decoration: none;
}
.nav-link:hover { background: var(--bg-2); color: var(--text); }
.nav-link.active {
    background: var(--bg-2);
    color: var(--text);
    box-shadow: inset 2px 0 0 var(--accent);
}
.nav-link i { width: 18px; height: 18px; }

/* ---- Buttons (custom, since we're not using Bootstrap anymore) ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .12s;
    text-decoration: none;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hov); }
.btn-secondary { background: var(--bg-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-3); }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: rgba(239,68,68,.1); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-2); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* ---- Form inputs ---- */
.input, .select, .textarea {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-size: 14px;
    transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(124,92,255,.15);
}
.input::placeholder { color: var(--text-dim); }
.label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}
.checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

/* ---- Tables ---- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    background: var(--bg-1);
}
.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 14px;
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255,255,255,0.015); }

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-up      { background: rgba(34,197,94,.12); color: #4ade80; }
.badge-down    { background: rgba(239,68,68,.12); color: #f87171; }
.badge-paused  { background: rgba(148,163,184,.12); color: #94a3b8; }
.badge-unknown { background: rgba(148,163,184,.12); color: #94a3b8; }

/* ---- Flash messages ---- */
.flash {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.flash-success { background: rgba(34,197,94,.1);  border: 1px solid rgba(34,197,94,.3);  color: #4ade80; }
.flash-danger  { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.3);  color: #f87171; }
.flash-info    { background: rgba(124,92,255,.1); border: 1px solid rgba(124,92,255,.3); color: #a78bfa; }

/* ---- Stat cards on detail page ---- */
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}
.stat-value {
    font-size: 28px;
    font-weight: 600;
    margin-top: 4px;
    letter-spacing: -0.02em;
}

/* ---- Truncate utility ---- */
.truncate-url {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Sidebar layout ---- */
.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}
.sidebar {
    background: var(--bg-1);
    border-right: 1px solid var(--border);
    padding: 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.main-area {
    padding: 28px 32px;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}
@media (max-width: 768px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: relative; height: auto; }
    .main-area { padding: 16px; }
}

/* ---- Page header ---- */
.page-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.page-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}
