/* ============================================================
   Breadcrumbs – Custom Stylesheet
   ============================================================ */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #0d1b2a;
    --sidebar-border: #1e3a5f;
    --accent: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.25);

    /* Readable text colors on dark backgrounds */
    --text-on-dark:        #e2e8f0;   /* headings, primary text */
    --text-on-dark-muted:  #94a3b8;   /* body copy, descriptions */
    --text-on-dark-subtle: #64748b;   /* timestamps, captions */
}

/* ============================================================
   AUTH PAGES (Login / Register) — dark card on dark background
   ============================================================ */

/* Labels above dark inputs must be light */
.auth-label {
    color: #cbd5e1 !important;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
}

/* Placeholder text visible on dark input */
.form-control.bg-dark::placeholder {
    color: #475569;
    opacity: 1;
}

/* Input text color */
.form-control.bg-dark {
    color: #f1f5f9 !important;
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

/* Fix browser autofill overriding dark background */
.form-control.bg-dark:-webkit-autofill,
.form-control.bg-dark:-webkit-autofill:hover,
.form-control.bg-dark:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #1e293b inset !important;
    -webkit-text-fill-color: #f1f5f9 !important;
    caret-color: #f1f5f9;
}

/* Focus ring */
.form-control.bg-dark:focus {
    background-color: #1e293b !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25) !important;
    color: #f1f5f9 !important;
    outline: none;
}

/* Helper text below inputs on dark cards */
.auth-hint {
    color: #64748b;
    font-size: 0.78rem;
    margin-top: 4px;
}

/* Primary button always white text */
.btn-primary {
    color: #ffffff !important;
}
.btn-primary:hover,
.btn-primary:focus {
    color: #ffffff !important;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */

body.landing {
    background: #0d1117;
    color: var(--text-on-dark);
}

/* All text on landing defaults to readable light color */
body.landing p,
body.landing li,
body.landing span:not(.badge):not(.token-cmd):not(.token-flag):not(.token-url):not(.token-str):not(.token-key):not(.token-val):not(.token-comment) {
    color: var(--text-on-dark-muted);
}

body.landing h1,
body.landing h2,
body.landing h3,
body.landing h4,
body.landing h5,
body.landing h6 {
    color: var(--text-on-dark) !important;
}

/* Bootstrap utility overrides for landing */
body.landing .text-white   { color: #ffffff !important; }
body.landing .text-primary { color: #60a5fa !important; }
body.landing .text-muted   { color: var(--text-on-dark-subtle) !important; }
body.landing .text-secondary { color: var(--text-on-dark-muted) !important; }

/* Navbar */
.navbar-dark-custom {
    background: rgba(13, 17, 23, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #1e293b;
}

.navbar-dark-custom .nav-link {
    color: var(--text-on-dark-muted) !important;
}
.navbar-dark-custom .nav-link:hover {
    color: #f1f5f9 !important;
}

/* Hero */
.hero-section {
    background: linear-gradient(135deg, #0d1117 0%, #0d2137 50%, #0a1628 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: var(--accent-glow);
    top: -200px; right: -200px;
    filter: blur(80px);
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(99, 37, 235, 0.15);
    bottom: -100px; left: -100px;
    filter: blur(80px);
    pointer-events: none;
}

.gradient-text {
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Code window */
.code-window {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.code-window-header {
    background: #1e293b;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #334155;
}

.code-window-dot { width: 12px; height: 12px; border-radius: 50%; }
.code-window-dot.red    { background: #ff5f57; }
.code-window-dot.yellow { background: #febc2e; }
.code-window-dot.green  { background: #28c840; }

.code-window-title {
    color: #64748b;
    font-size: 0.78rem;
    font-family: monospace;
    margin-left: 8px;
}

.code-window-body {
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    color: #e2e8f0;
}

.code-window-body .token-cmd     { color: #7dd3fc !important; }
.code-window-body .token-flag    { color: #fb923c !important; }
.code-window-body .token-url     { color: #a5d6ff !important; }
.code-window-body .token-str     { color: #86efac !important; }
.code-window-body .token-key     { color: #f87171 !important; }
.code-window-body .token-val     { color: #fbbf24 !important; }
.code-window-body .token-comment { color: #64748b !important; font-style: italic; }

/* Stats bar */
.stats-bar {
    background: #0f172a;
    border-top: 1px solid #1e293b;
    border-bottom: 1px solid #1e293b;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: #60a5fa;
    line-height: 1;
}

/* Feature cards */
.feature-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.15);
}

.feature-card h5 { color: #f1f5f9 !important; }
.feature-card p  { color: var(--text-on-dark-muted) !important; }

.feature-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #60a5fa;
}

/* Steps */
.step-number {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Sections */
.section-dark   { background: #0d1117; }
.section-darker { background: #080d14; }

/* Footer */
.site-footer {
    background: #080d14;
    border-top: 1px solid #1e293b;
}

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */

body.dashboard-body {
    background: #f0f4f8;
    min-height: 100vh;
}

.sidebar-nav {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.2s;
}

.sidebar-brand    { border-bottom: 1px solid var(--sidebar-border); }
.sidebar-divider  { border-color: var(--sidebar-border); opacity: 1; }

.sidebar-nav .nav-link {
    color: #94a3b8;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.88rem;
    transition: background 0.15s, color 0.15s;
}
.sidebar-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,0.07); }
.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(37, 99, 235, 0.25);
    border-left: 3px solid var(--accent);
}
.sidebar-nav .nav-link.small { font-size: 0.82rem; }

.sidebar-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

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

.topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
}

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

/* Stat cards */
.stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    transition: box-shadow 0.15s;
}
.stat-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

.stat-card-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-card-value { font-size: 2rem; font-weight: 800; line-height: 1; color: #0f172a; }
.stat-card-label { font-size: 0.8rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }

/* Log table */
.log-table-wrapper {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.log-row { cursor: pointer; transition: background 0.1s; }
.log-row:hover { background: #f8fafc; }

.log-detail-row td { background: #f8fafc; border-top: none !important; padding: 0 !important; }

.log-detail-content {
    padding: 12px 16px;
    font-family: monospace;
    font-size: 0.82rem;
    white-space: pre-wrap;
    word-break: break-all;
    color: #334155;
    border-left: 3px solid var(--accent);
    margin: 8px 16px;
    background: #f1f5f9;
    border-radius: 6px;
}

/* Severity badges */
.badge-severity {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 20px;
}

/* Filter bar */
.filter-bar {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

/* Token display */
.token-mask {
    font-family: monospace;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    color: #64748b;
}

/* Dashboard chart card */
.chart-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}

/* ============================================================
   MOBILE SIDEBAR TOGGLE BUTTON
   ============================================================ */

.sidebar-mobile-toggle {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1060;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: #fff;
    display: none; /* shown via media query */
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37,99,235,0.45);
    cursor: pointer;
    transition: background 0.15s;
}
.sidebar-mobile-toggle:hover { background: #1d4ed8; }

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1040;
    backdrop-filter: blur(2px);
}
.sidebar-backdrop.show { display: block; }

/* ============================================================
   RESPONSIVE — dashboard layout
   ============================================================ */

@media (max-width: 991.98px) {
    /* Show the hamburger button */
    .sidebar-mobile-toggle { display: flex; }

    /* Sidebar: slide in from left (over content, not push) */
    .sidebar-nav {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 1050;
        overflow-y: auto;
        overflow-x: hidden;
    }
    .sidebar-nav.open {
        transform: translateX(0);
        box-shadow: 4px 0 32px rgba(0,0,0,0.5);
    }

    /* Main content takes full width */
    .main-content { margin-left: 0; }

    /* Topbar: pad left to clear the hamburger button */
    .topbar { padding-left: 64px; }

    /* Reduce content padding on small screens */
    .content-area { padding: 12px; }

    /* Stat cards: smaller value font */
    .stat-card-value { font-size: 1.5rem; }

    /* Log table: horizontal scroll */
    .log-table-wrapper { overflow-x: auto; }

    /* Filter bar: tighter */
    .filter-bar { padding: 10px 12px; }

    /* Chart card: reduce padding */
    .chart-card { padding: 14px; }
}

@media (max-width: 575.98px) {
    .topbar { padding: 10px 12px 10px 62px; }
    .content-area { padding: 10px; }
}

/* ============================================================
   RESPONSIVE — landing page navbar
   ============================================================ */

/* Make hamburger icon visible on dark navbar */
.navbar-dark-custom .navbar-toggler {
    border-color: rgba(255,255,255,0.2);
    padding: 4px 8px;
}
.navbar-dark-custom .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255%2c255%2c255%2c0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Collapsed navbar on mobile: proper dark background + padding */
@media (max-width: 991.98px) {
    .navbar-dark-custom .navbar-collapse {
        background: #0d1117;
        border-top: 1px solid #1e293b;
        padding: 12px 0 16px;
        margin-top: 8px;
    }
    .navbar-dark-custom .navbar-collapse .nav-link {
        padding: 8px 4px;
    }
    .navbar-dark-custom .navbar-collapse .d-flex {
        flex-direction: column;
        gap: 8px !important;
        margin-top: 8px;
    }
    .navbar-dark-custom .navbar-collapse .d-flex .btn {
        width: 100%;
        text-align: center;
    }

    /* Hero: reduce top padding, stack columns */
    .hero-section { min-height: auto; padding-top: 80px !important; }

    /* Code window: smaller font on mobile */
    .code-window-body { font-size: 0.72rem; padding: 14px; }

    /* Stats bar numbers */
    .stat-number { font-size: 1.5rem; }

    /* Sections: reduce vertical padding */
    section[style*="padding:80px"] { padding: 48px 0 !important; }
}

/* Pulse animation for emergency */
@keyframes pulse-danger {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.badge-emergency { animation: pulse-danger 1.5s ease-in-out infinite; }
