/* =====================================================================
   GÜVENLİK İSTASYONU — Stil Dosyası
   Tasarım dili: koyu "operasyon merkezi" estetiği, monospace tipografi,
   tehlike seviyesine göre renk kodlama.
   ===================================================================== */

:root {
    /* --- Palet --- */
    --bg-void:        #0a0d12;
    --bg-panel:       #11161d;
    --bg-panel-head:  #151b24;
    --bg-raised:      #1a212b;
    --border-line:    #232b36;
    --border-line-soft: #1c232d;

    --text-primary:   #e7ecf2;
    --text-secondary: #8a96a6;
    --text-dim:       #5a6575;

    --accent-cyan:    #4fd1e8;
    --accent-amber:   #ff9d4a;
    --accent-red:     #ff5c5c;
    --accent-green:   #3ddc84;
    --accent-violet:  #a78bfa;

    --font-mono: 'JetBrains Mono', 'IBM Plex Mono', 'SF Mono', 'Consolas', monospace;
    --font-ui: 'IBM Plex Sans', 'Inter', -apple-system, sans-serif;

    --radius: 6px;
    --transition: 160ms ease;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }

::selection { background: var(--accent-cyan); color: #06090d; }

/* Erişilebilirlik: klavye odağı her zaman görünür */
:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

/* ============================== ORTAK BİLEŞENLER ============================== */

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 2px;
}
.dot--ok    { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); animation: pulse 2.4s infinite; }
.dot--idle  { background: var(--text-dim); }
.dot--error { background: var(--accent-red); box-shadow: 0 0 8px var(--accent-red); }
.dot--warn  { background: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber); }

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

.btn-primary {
    width: 100%;
    background: var(--accent-cyan);
    color: #06090d;
    border: none;
    border-radius: var(--radius);
    padding: 13px 18px;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.08em;
    transition: transform var(--transition), box-shadow var(--transition);
}
.btn-primary:hover { box-shadow: 0 0 0 3px rgba(79, 209, 232, 0.25); }
.btn-primary:active { transform: scale(0.985); }
.btn-primary:disabled { opacity: 0.55; cursor: progress; }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-line);
    color: var(--text-secondary);
    border-radius: var(--radius);
    padding: 7px 12px;
    font-size: 12px;
    font-family: var(--font-mono);
    transition: border-color var(--transition), color var(--transition);
}
.btn-ghost:hover { border-color: var(--accent-cyan); color: var(--accent-cyan); }
.btn-ghost--danger:hover { border-color: var(--accent-red); color: var(--accent-red); }

/* ============================== LOGIN SAYFASI ============================== */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(79, 209, 232, 0.08), transparent),
        var(--bg-void);
}

.login-scanline {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0.5;
    animation: scan 5s linear infinite;
    pointer-events: none;
}
@keyframes scan {
    0% { transform: translateY(0); }
    100% { transform: translateY(100vh); }
}

.login-wrap { width: 100%; max-width: 380px; padding: 24px; }

.login-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-line);
    border-radius: 10px;
    padding: 32px 28px;
    box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
}

.login-card__head { text-align: center; margin-bottom: 28px; }

.login-glyph {
    display: inline-block;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-size: 22px;
    margin-bottom: 10px;
}

.login-card__head h1 {
    font-family: var(--font-mono);
    font-size: 16px;
    letter-spacing: 0.12em;
    margin: 0 0 6px;
    color: var(--text-primary);
}

.login-sub {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
}
.field input {
    background: var(--bg-raised);
    border: 1px solid var(--border-line);
    border-radius: var(--radius);
    padding: 11px 12px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    transition: border-color var(--transition);
}
.field input:focus { border-color: var(--accent-cyan); outline: none; }

.login-error {
    background: rgba(255, 92, 92, 0.1);
    border: 1px solid rgba(255, 92, 92, 0.35);
    color: var(--accent-red);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 12.5px;
    margin: 0;
}

.login-card__foot {
    margin-top: 22px;
    text-align: center;
    font-size: 11px;
    color: var(--text-dim);
}

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

.dash-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 22px;
    background: var(--bg-panel-head);
    border-bottom: 1px solid var(--border-line);
    flex-wrap: wrap;
}

.topbar__brand { display: flex; align-items: center; gap: 8px; }
.topbar__title {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.1em;
    color: var(--text-primary);
}

.topbar__status {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.topbar__status strong { color: var(--text-primary); font-weight: 600; }
.topbar__sep { color: var(--text-dim); }

.topbar__actions { display: flex; align-items: center; gap: 10px; }
.topbar__user {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-cyan);
    padding: 4px 10px;
    border: 1px solid var(--border-line);
    border-radius: 4px;
}

.grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1.1fr 1.6fr 1.3fr;
    gap: 14px;
    padding: 16px;
    align-items: start;
    min-height: 0;
}

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-line);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 130px);
    overflow: hidden;
}

.panel__head {
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border-line-soft);
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.panel__head h2 {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.04em;
    margin: 0;
    color: var(--text-primary);
}
.panel__hint {
    font-size: 11px;
    color: var(--text-dim);
}

.panel__body {
    padding: 14px 16px 16px;
    overflow: hidden;
}
.panel__body--scroll {
    overflow-y: auto;
    flex: 1;
}
.panel__body--scroll::-webkit-scrollbar { width: 8px; }
.panel__body--scroll::-webkit-scrollbar-track { background: transparent; }
.panel__body--scroll::-webkit-scrollbar-thumb {
    background: var(--border-line);
    border-radius: 4px;
}
.panel__body--scroll::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* --- Sol panel: tehdit barları --- */

.threat-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 10px;
    margin-bottom: 14px;
}
.threat-row:last-child { margin-bottom: 0; }

.threat-row__label {
    font-size: 12.5px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.threat-row__count {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}
.threat-row__bar-track {
    grid-column: 1 / -1;
    height: 6px;
    background: var(--bg-raised);
    border-radius: 3px;
    overflow: hidden;
}
.threat-row__bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
    transition: width 600ms ease;
}

.threat-rank {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    width: 16px;
    flex-shrink: 0;
}

/* --- Orta panel: CVE kartları --- */

.cve-card {
    border: 1px solid var(--border-line-soft);
    background: var(--bg-raised);
    border-radius: var(--radius);
    padding: 12px 13px;
    margin-bottom: 10px;
}
.cve-card:last-child { margin-bottom: 0; }

.cve-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}
.cve-card__id {
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
}
.cve-score {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    flex-shrink: 0;
}
.cve-score--critical { background: rgba(255, 92, 92, 0.16); color: var(--accent-red); }
.cve-score--high { background: rgba(255, 157, 74, 0.16); color: var(--accent-amber); }

.cve-card__desc {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0 0 8px;
}
.cve-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-dim);
}
.cve-card__foot a { font-family: var(--font-mono); }

/* --- Sağ panel: haber kartları --- */

.news-card {
    padding: 11px 0;
    border-bottom: 1px solid var(--border-line-soft);
}
.news-card:last-child { border-bottom: none; padding-bottom: 0; }
.news-card:first-child { padding-top: 0; }

.news-card__title {
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-primary);
    margin: 0 0 6px;
    display: block;
}
.news-card__title:hover { color: var(--accent-cyan); }

.news-card__desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 7px;
}

.news-card__meta {
    display: flex;
    gap: 8px;
    font-size: 10.5px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}
.news-card__source {
    color: var(--accent-violet);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* --- skeleton loading --- */

.skeleton-list { display: flex; flex-direction: column; gap: 12px; }
.skeleton-bar, .skeleton-card {
    background: linear-gradient(90deg, var(--bg-raised) 25%, var(--border-line) 50%, var(--bg-raised) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
    border-radius: var(--radius);
}
.skeleton-bar { height: 18px; }
.skeleton-card { height: 64px; }
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.empty-state, .error-state {
    text-align: center;
    padding: 24px 12px;
    color: var(--text-dim);
    font-size: 12.5px;
    line-height: 1.6;
}
.error-state { color: var(--accent-amber); }

/* --- footer --- */

.footbar {
    text-align: center;
    padding: 10px;
    font-size: 11px;
    color: var(--text-dim);
    border-top: 1px solid var(--border-line-soft);
}

/* ============================== RESPONSIVE ============================== */

@media (max-width: 1100px) {
    .grid {
        grid-template-columns: 1fr;
    }
    .panel {
        max-height: none;
    }
    .panel__body--scroll {
        max-height: 420px;
    }
}

@media (max-width: 560px) {
    .topbar { flex-direction: column; align-items: flex-start; }
    .topbar__status { order: 3; width: 100%; }
}
