/* =========================================================
   Veri Sızıntısı PULSE — Stil Dosyası
   ========================================================= */

/* ── CSS Değişkenleri (Dark — varsayılan) ────────────────── */
:root {
    --bg: #0b0d10;
    --bg-2: #12141a;
    --bg-3: #1a1d25;
    --bg-4: #22252e;
    --border: #262a33;
    --border-2: #333845;
    --text: #eef0f4;
    --text-2: #c0c5d0;
    --muted: #8891a4;
    --accent: #6366f1;
    --accent-h: #818cf8;
    --accent-bg: rgba(99,102,241,.1);
    --green: #22c55e;
    --green-bg: rgba(34,197,94,.1);
    --red: #ef4444;
    --red-bg: rgba(239,68,68,.1);
    --yellow: #eab308;
    --yellow-bg: rgba(234,179,8,.1);
    --cyan: #06b6d4;
    --cyan-bg: rgba(6,182,212,.1);

    --sidebar-w: 260px;
    --topbar-h: 60px;
    --radius: 8px;
    --radius-sm: 6px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* ── Light Tema ──────────────────────────────────────────── */
[data-theme="light"] {
    --bg: #f4f5f7;
    --bg-2: #ffffff;
    --bg-3: #f0f1f4;
    --bg-4: #e6e8ed;
    --border: #dfe1e6;
    --border-2: #cdd0d8;
    --text: #0d0f14;
    --text-2: #3b3f4a;
    --muted: #6b7280;
    --accent: #4f46e5;
    --accent-h: #4338ca;
    --accent-bg: rgba(79,70,229,.08);
    --green-bg: rgba(34,197,94,.08);
    --red-bg: rgba(239,68,68,.08);
    --yellow-bg: rgba(234,179,8,.08);
    --cyan-bg: rgba(6,182,212,.08);
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

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

/* ── Layout ──────────────────────────────────────────────── */
.pulse-layout {
    display: flex;
    min-height: 100vh;
}

.pulse-layout-full {
    display: block;
}

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

.pulse-content-full {
    margin-left: 0;
}

.pulse-main {
    flex: 1;
    padding: 24px;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.pulse-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow-y: auto;
}

.pulse-sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px 20px 16px;
    text-decoration: none;
    color: var(--text);
}

.pulse-sidebar-logo-text {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.3px;
}

.pulse-sidebar-logo-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    background: var(--accent);
    color: #fff;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
}

.pulse-nav {
    flex: 1;
    padding: 0 12px;
}

.pulse-nav-group {
    margin-bottom: 20px;
}

.pulse-nav-group-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    padding: 0 8px;
    margin-bottom: 6px;
}

.pulse-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    transition: background .15s, color .15s;
    text-decoration: none;
}

.pulse-nav-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: .7;
}

.pulse-nav-link:hover {
    background: var(--bg-3);
    color: var(--text);
}

.pulse-nav-link.active {
    background: var(--accent-bg);
    color: var(--accent);
}

.pulse-nav-link.active svg { opacity: 1; }

.pulse-sidebar-footer {
    padding: 16px 20px;
    font-size: 11px;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

/* ── Topbar ──────────────────────────────────────────────── */
.pulse-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-h);
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.pulse-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pulse-topbar-title {
    font-size: 15px;
    font-weight: 600;
}

.pulse-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pulse-topbar-user {
    font-size: 13px;
    color: var(--muted);
}

.pulse-topbar-logout,
.pulse-topbar-login {
    font-size: 13px;
    color: var(--muted);
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all .15s;
}

.pulse-topbar-logout:hover,
.pulse-topbar-login:hover {
    color: var(--text);
    border-color: var(--border-2);
}

.pulse-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
}

.pulse-sidebar-toggle svg {
    width: 20px;
    height: 20px;
}

/* ── Theme Toggle ────────────────────────────────────────── */
.pulse-theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px;
    cursor: pointer;
    color: var(--muted);
    display: flex;
    align-items: center;
    transition: all .15s;
}

.pulse-theme-toggle:hover {
    color: var(--text);
    border-color: var(--border-2);
}

.pulse-theme-toggle svg { width: 16px; height: 16px; }
.pulse-theme-toggle .icon-moon { display: none; }
[data-theme="light"] .pulse-theme-toggle .icon-sun { display: none; }
[data-theme="light"] .pulse-theme-toggle .icon-moon { display: block; }

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

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

.pulse-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
}

.pulse-stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.5px;
    line-height: 1.2;
}

.pulse-stat-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
}

.pulse-stat-change.up {
    color: var(--green);
    background: var(--green-bg);
}

.pulse-stat-change.down {
    color: var(--red);
    background: var(--red-bg);
}

/* ── Cards & Panels ──────────────────────────────────────── */
.pulse-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

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

.pulse-card-title {
    font-size: 14px;
    font-weight: 600;
}

.pulse-card-body {
    padding: 20px;
}

/* ── Chart Container ─────────────────────────────────────── */
.pulse-chart-wrap {
    position: relative;
    height: 300px;
}

/* ── Table ────────────────────────────────────────────────── */
.pulse-table {
    width: 100%;
    border-collapse: collapse;
}

.pulse-table th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    text-align: left;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.pulse-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.pulse-table tbody tr:hover {
    background: var(--bg-3);
}

.pulse-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Progress bar (sayfa yüzdesi) */
.pulse-progress {
    height: 4px;
    background: var(--bg-4);
    border-radius: 2px;
    margin-top: 4px;
}

.pulse-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width .3s;
}

/* ── Date Range Filter ───────────────────────────────────── */
.pulse-date-filter {
    display: flex;
    gap: 4px;
    background: var(--bg-3);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.pulse-date-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
}

.pulse-date-btn:hover {
    color: var(--text);
}

.pulse-date-btn.active {
    background: var(--bg-2);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

/* ── Site Selector ───────────────────────────────────────── */
.pulse-site-select {
    padding: 6px 12px;
    font-size: 13px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
}

/* ── Auth Pages ──────────────────────────────────────────── */
.pulse-auth-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--topbar-h) - 48px);
    padding: 24px;
}

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

.pulse-auth-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    justify-content: center;
}

.pulse-auth-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
}

.pulse-auth-subtitle {
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    margin-bottom: 20px;
}

.pulse-auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.pulse-auth-footer a {
    font-size: 13px;
    color: var(--muted);
}

/* ── Forms ────────────────────────────────────────────────── */
.pulse-form-group {
    margin-bottom: 16px;
}

.pulse-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 6px;
}

.pulse-input {
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: border-color .15s;
    font-family: var(--font);
}

.pulse-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

/* ── Buttons ─────────────────────────────────────────────── */
.pulse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all .15s;
    font-family: var(--font);
}

.pulse-btn-primary {
    background: var(--accent);
    color: #fff;
}

.pulse-btn-primary:hover {
    background: var(--accent-h);
}

.pulse-btn-full {
    width: 100%;
}

.pulse-btn-secondary {
    background: var(--bg-3);
    color: var(--text);
    border: 1px solid var(--border);
}

.pulse-btn-secondary:hover {
    border-color: var(--border-2);
}

/* ── Alerts ──────────────────────────────────────────────── */
.pulse-alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.pulse-alert-error {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid rgba(239,68,68,.2);
}

.pulse-alert-success {
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid rgba(34,197,94,.2);
}

/* ── Grid layouts ────────────────────────────────────────── */
.pulse-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ── Realtime indicator ──────────────────────────────────── */
.pulse-realtime {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-realtime-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse-blink 2s infinite;
}

@keyframes pulse-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .3; }
}

.pulse-realtime-count {
    font-size: 24px;
    font-weight: 700;
}

.pulse-realtime-label {
    font-size: 12px;
    color: var(--muted);
}

/* ── Snippet code block ──────────────────────────────────── */
.pulse-code {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    color: var(--text-2);
    position: relative;
}

.pulse-code-copy {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    font-size: 11px;
    background: var(--bg-4);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--muted);
    cursor: pointer;
}

.pulse-code-copy:hover {
    color: var(--text);
}

/* ── Empty state ─────────────────────────────────────────── */
.pulse-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.pulse-empty-icon {
    font-size: 48px;
    opacity: .15;
    margin-bottom: 12px;
}

/* ── Section header ──────────────────────────────────────── */
.pulse-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.pulse-section-title {
    font-size: 18px;
    font-weight: 700;
}

/* ── Badge ────────────────────────────────────────────────── */
.pulse-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
}

.pulse-badge-accent {
    background: var(--accent-bg);
    color: var(--accent);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .pulse-sidebar {
        transform: translateX(-100%);
        transition: transform .25s;
    }

    .pulse-sidebar.open {
        transform: translateX(0);
    }

    .pulse-content {
        margin-left: 0;
    }

    .pulse-sidebar-toggle {
        display: flex;
    }

    .pulse-main {
        padding: 16px;
    }

    .pulse-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .pulse-grid-2 {
        grid-template-columns: 1fr;
    }

    .pulse-chart-wrap {
        height: 220px;
    }
}

@media (max-width: 480px) {
    .pulse-stats-grid {
        grid-template-columns: 1fr;
    }
}
