/* ═══════════════════════════════════════════════════
   main.css — Scam Detector Premium Dark Theme
   ═══════════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ── CSS Custom Properties (Design Tokens) ── */
:root {
    /* Primary Palette — kurumsal mavi (tek marka accent) */
    --primary-50: #eaf1fd;
    --primary-100: #cddffb;
    --primary-200: #a6c4f7;
    --primary-300: #7ba6f2;
    --primary-400: #5389ed;
    --primary-500: #3b74e8;
    --primary-600: #2f63cf;
    --primary-700: #2652ab;
    --primary-800: #1f4489;
    --primary-900: #17315f;
    --primary-glow: rgba(59, 116, 232, 0.28);

    /* Accent Colors — işlevsel durum renkleri (nötr, neon değil) */
    --accent-cyan: #4c82f7;
    --accent-cyan-glow: rgba(76, 130, 247, 0.20);
    --accent-green: #3fb950;
    --accent-green-glow: rgba(63, 185, 80, 0.18);
    --accent-red: #e5484d;
    --accent-red-glow: rgba(229, 72, 77, 0.18);
    --accent-yellow: #d9a441;
    --accent-purple: #5389ed;
    --accent-purple-glow: rgba(83, 137, 237, 0.18);

    /* Surfaces */
    --bg-primary: #06080E;
    --bg-secondary: #0A0D14;
    --bg-tertiary: #0E1118;
    --bg-card: #111420;
    --bg-card-hover: #151825;
    --bg-elevated: #1A1E2E;
    --bg-input: #0C0F16;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.14);
    --border-focus: var(--primary-500);

    /* Text */
    --text-primary: #F0F4F8;
    --text-secondary: #A0AAB8;
    --text-tertiary: #6B7685;
    --text-muted: #4A5168;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow-primary: 0 0 30px var(--primary-glow);
    --shadow-glow-cyan: 0 0 30px var(--accent-cyan-glow);

    /* Transitions */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --duration-fast: 0.15s;
    --duration-normal: 0.3s;
    --duration-slow: 0.5s;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* ── Reset & Globals ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-secondary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection {
    background: rgba(59, 116, 232, 0.3);
    color: #fff;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-500), var(--primary-700));
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary-400); }

/* ── Animated Background Noise Texture ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ── Buttons ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-300) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-smooth);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--duration-normal);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-primary), var(--shadow-md);
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: translateY(0) scale(0.98); }

/* ── Checkbox Styling ── */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Global Toast Notifications ── */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    min-width: 320px;
    max-width: 420px;
    background: rgba(15, 18, 26, 0.9);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: var(--shadow-xl), 0 0 30px rgba(0, 0, 0, 0.4);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: auto;
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-success { border-left: 4px solid var(--accent-green); }
.toast-success .toast-icon { background: rgba(63, 185, 80, 0.1); color: var(--accent-green); }

.toast-error { border-left: 4px solid var(--accent-red); }
.toast-error .toast-icon { background: rgba(229, 72, 77, 0.1); color: var(--accent-red); }

.toast-info { border-left: 4px solid var(--accent-cyan); }
.toast-info .toast-icon { background: rgba(76, 130, 247, 0.1); color: var(--accent-cyan); }

/* ── Loading States & Spinners ── */
.btn-loading {
    color: transparent !important;
    pointer-events: none;
    position: relative;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: calc(50% - 9px);
    left: calc(50% - 9px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(6, 8, 14, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner-ring {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(59, 116, 232, 0.15);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
}

/* ── Error Panel (User Friendly) ── */
.error-panel {
    background: rgba(229, 72, 77, 0.05);
    border: 1px solid rgba(229, 72, 77, 0.1);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}

.error-panel-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--accent-red);
}

.error-panel-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.error-panel-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    padding: 10px 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-smooth);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}
.btn-secondary:hover {
    border-color: var(--primary-500);
    color: #fff;
    background: rgba(59, 116, 232, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(59, 116, 232, 0.10);
}

.btn-danger {
    background: rgba(229, 72, 77, 0.1);
    color: #FF8A80;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(229, 72, 77, 0.2);
    cursor: pointer;
    transition: all var(--duration-normal);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-danger:hover {
    background: rgba(229, 72, 77, 0.2);
    border-color: rgba(229, 72, 77, 0.4);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 28px;
    transition: all var(--duration-normal) var(--ease-smooth);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 116, 232, 0.3), transparent);
    opacity: 0;
    transition: opacity var(--duration-normal);
}
.card:hover {
    border-color: rgba(59, 116, 232, 0.15);
    background: var(--bg-card-hover);
}
.card:hover::before { opacity: 1; }

/* ── Alerts / Messages ── */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: alertSlideIn 0.4s var(--ease-spring);
    backdrop-filter: blur(8px);
}
@keyframes alertSlideIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.alert-success {
    background: rgba(63, 185, 80, 0.08);
    color: var(--accent-green);
    border: 1px solid rgba(63, 185, 80, 0.2);
    box-shadow: 0 0 20px rgba(63, 185, 80, 0.05);
}
.alert-success::before { content: '✓'; font-weight: 900; }
.alert-error {
    background: rgba(229, 72, 77, 0.08);
    color: #FF8A80;
    border: 1px solid rgba(229, 72, 77, 0.2);
    box-shadow: 0 0 20px rgba(229, 72, 77, 0.05);
}
.alert-error::before { content: '✕'; font-weight: 900; }
.alert-warning {
    background: rgba(59, 116, 232, 0.08);
    color: var(--primary-300);
    border: 1px solid rgba(59, 116, 232, 0.2);
}
.alert-warning::before { content: '⚠'; }
.alert-info {
    background: rgba(76, 130, 247, 0.08);
    color: var(--accent-cyan);
    border: 1px solid rgba(76, 130, 247, 0.2);
}
.alert-info::before { content: 'ℹ'; }

/* ── Forms ── */
.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    transition: all var(--duration-normal) var(--ease-smooth);
    outline: none;
}
.form-input:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 116, 232, 0.12), 0 0 20px rgba(59, 116, 232, 0.06);
    background: var(--bg-tertiary);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:hover:not(:focus) { border-color: var(--border-strong); }

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-group { margin-bottom: 18px; }

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7685' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
.badge-green {
    background: rgba(63, 185, 80, 0.08);
    color: var(--accent-green);
    border: 1px solid rgba(63, 185, 80, 0.2);
}
.badge-red {
    background: rgba(229, 72, 77, 0.08);
    color: #FF8A80;
    border: 1px solid rgba(229, 72, 77, 0.2);
}
.badge-orange {
    background: rgba(59, 116, 232, 0.10);
    color: var(--primary-300);
    border: 1px solid rgba(59, 116, 232, 0.25);
}
.badge-blue {
    background: rgba(76, 130, 247, 0.08);
    color: var(--accent-cyan);
    border: 1px solid rgba(76, 130, 247, 0.2);
}

/* ── Tabs ── */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 5px;
    margin-bottom: 28px;
    border: 1px solid var(--border-subtle);
}
.tab-btn {
    padding: 10px 22px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-smooth);
    position: relative;
}
.tab-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.03); }
.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-300));
    color: #fff;
    box-shadow: 0 2px 12px rgba(59, 116, 232, 0.3);
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: tabFadeIn 0.35s var(--ease-smooth); }
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Stat Cards ── */
.stat-card {
    background: linear-gradient(145deg, var(--bg-elevated), var(--bg-card));
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    transition: all var(--duration-normal) var(--ease-smooth);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-300));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--duration-slow) var(--ease-out-expo);
}
.stat-card:hover {
    border-color: rgba(59, 116, 232, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 20px rgba(59, 116, 232, 0.06);
}
.stat-card:hover::after { transform: scaleX(1); }
.stat-val {
    font-size: 30px;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Topbar ── */
.topbar {
    background: rgba(10, 13, 20, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}
.topbar-sub {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
    font-weight: 500;
}

/* ── Section ── */
.section-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
}

/* ── Grid helpers ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .topbar { padding: 12px 16px; }
}

/* ── Container ── */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}
.page-content {
    padding: 32px;
    max-width: 1280px;
    margin: 0 auto;
}

/* ── Log Row ── */
.log-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--duration-fast);
    border-radius: var(--radius-sm);
}
.log-row:hover {
    background: rgba(59, 116, 232, 0.03);
    border-color: rgba(59, 116, 232, 0.08);
}
.log-row:last-child { border-bottom: none; }

/* ── Account Card ── */
.account-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--duration-normal) var(--ease-smooth);
    position: relative;
}
.account-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0%;
    background: linear-gradient(180deg, var(--primary-500), var(--primary-300));
    border-radius: 0 2px 2px 0;
    transition: height var(--duration-normal) var(--ease-spring);
}
.account-card:hover {
    border-color: rgba(59, 116, 232, 0.15);
    background: rgba(17, 20, 32, 0.95);
}
.account-card:hover::before { height: 60%; }

/* ── Section Card ── */
.section-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    transition: all var(--duration-normal);
}
.section-card:hover { border-color: rgba(59, 116, 232, 0.15); }

/* ── Animations ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.5s var(--ease-smooth) backwards; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animate-float { animation: float 4s ease-in-out infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* Stagger animation delays */
.fade-in:nth-child(1) { animation-delay: 0s; }
.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.2s; }
.fade-in:nth-child(4) { animation-delay: 0.3s; }

/* ── Gradient Text Helper ── */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-300), var(--accent-cyan));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
}

/* ── Skeleton Loading ── */
.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card-hover) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ── Focus Visible ── */
:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* ── Django Messages ── */
.messages-container { padding: 0 32px; }

/* ── Risk Score Colors ── */
.score-high {
    color: #FF8A80;
    font-weight: 800;
    text-shadow: 0 0 12px rgba(229, 72, 77, 0.3);
}
.score-med {
    color: var(--accent-yellow);
    font-weight: 700;
    text-shadow: 0 0 12px rgba(217, 164, 65, 0.2);
}
.score-low {
    color: var(--accent-green);
    text-shadow: 0 0 12px rgba(63, 185, 80, 0.2);
}

/* ── Risk Tag ── */
.risk-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    margin: 2px 4px 2px 0;
    background: rgba(59, 116, 232, 0.08);
    color: var(--primary-300);
    border: 1px solid rgba(59, 116, 232, 0.15);
    font-weight: 600;
}

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.visible { display: flex; }
.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-2xl);
    padding: 36px;
    width: 100%;
    max-width: 480px;
    animation: modalAppear 0.35s var(--ease-spring);
    box-shadow: var(--shadow-xl), 0 0 60px rgba(59, 116, 232, 0.05);
}
@keyframes modalAppear {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

/* ── Sidebar Shared Styles ── */
.portal-sidebar, .scanner-sidebar, .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background: linear-gradient(180deg, #0A0D14, #080A10);
    border-right: 1px solid var(--border-subtle);
    padding: 28px 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    transition: transform var(--duration-normal) var(--ease-smooth);
}

.portal-sidebar .logo, .scanner-sidebar .logo, .admin-sidebar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 24px;
    margin-bottom: 36px;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.portal-sidebar .nav-item, .scanner-sidebar .nav-item, .admin-sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 24px;
    color: var(--text-tertiary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--duration-normal) var(--ease-smooth);
    cursor: pointer;
    border-left: 3px solid transparent;
    margin: 2px 0;
}

.portal-sidebar .nav-item:hover, .scanner-sidebar .nav-item:hover, .admin-sidebar .nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.portal-sidebar .nav-item.active, .scanner-sidebar .nav-item.active, .admin-sidebar .nav-item.active {
    color: var(--primary-500);
    background: rgba(59, 116, 232, 0.06);
    border-left-color: var(--primary-500);
    border-right: none;
    font-weight: 600;
}

.portal-sidebar .nav-icon, .scanner-sidebar .nav-icon, .admin-sidebar .nav-icon {
    font-size: 18px;
    transition: transform var(--duration-normal) var(--ease-spring);
}

.portal-sidebar .nav-item:hover .nav-icon, 
.scanner-sidebar .nav-item:hover .nav-icon,
.admin-sidebar .nav-item:hover .nav-icon {
    transform: scale(1.15);
}

.portal-main, .scanner-main, .admin-main {
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left var(--duration-normal) var(--ease-smooth);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 40;
    backdrop-filter: blur(4px);
}

@media (max-width: 1024px) {
    .portal-sidebar, .scanner-sidebar, .admin-sidebar {
        transform: translateX(-100%);
    }
    .portal-sidebar.open, .scanner-sidebar.open, .admin-sidebar.open {
        transform: translateX(0);
    }
    .portal-main, .scanner-main, .admin-main {
        margin-left: 0;
    }
    .sidebar-overlay.open {
        display: block;
    }
}

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, rgba(59, 116, 232, 0.06), rgba(76, 130, 247, 0.04), rgba(83, 137, 237, 0.03));
    border: 1px solid rgba(59, 116, 232, 0.12);
    border-radius: var(--radius-xl);
    padding: 40px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.welcome-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59, 116, 232, 0.08) 0%, transparent 70%);
    pointer-events: none;
}
.welcome-title {
    font-size: 28px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}
.welcome-sub {
    font-size: 15px;
    color: var(--text-secondary);
}

/* ── Responsive for Sidebar Pages ──
   1024px altında kenar çubuğu ekran dışına kayan bir çekmecedir (yukarıdaki kural);
   bu yüzden içerik sola yaslanır. Eskiden burada 64px boşluk bırakılıyordu ve
   gizli menünün yerinde boş bir şerit kalıyordu. */
@media (max-width: 768px) {
    .portal-main, .scanner-main, .admin-main { margin-left: 0; }
    .page-content { padding: 16px; }
    /* Üst şerit: başlık ve düğmeler alt alta sarar */
    .topbar { flex-wrap: wrap; gap: 12px; }
    .topbar > div { min-width: 0; flex-wrap: wrap; }
    .topbar-title { font-size: 18px; }
    /* Sekmeler yatay kaydırılır; sayfa taşmaz */
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .tab-btn { flex: none; white-space: nowrap; min-height: 44px; }
    .log-row { flex-wrap: wrap; gap: 10px; }
    .modal-box { padding: 22px 18px; }
}

/* Mobil: odaklanınca iOS Safari yakınlaştırması olmasın (yazı ≥16px), dokunma alanı ≥44px */
@media (max-width: 768px), (pointer: coarse) {
    .form-input, input[type="text"], input[type="email"], input[type="password"],
    input[type="url"], input[type="number"], input[type="date"], select, textarea { font-size: 16px !important; }
}
@media (pointer: coarse) {
    .form-input { min-height: 44px; }
    .btn-sm { min-width: 40px; min-height: 40px; }
}
/* Hamburger düğmesi: en az 44×44 dokunma alanı */
@media (max-width: 1024px) {
    .mobile-menu-btn { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
}

/* ── Utility: Glow Ring ── */
.glow-ring {
    position: relative;
}
.glow-ring::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: conic-gradient(from 0deg, var(--primary-500), var(--accent-cyan), var(--accent-purple), var(--primary-500));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s;
    filter: blur(8px);
}
.glow-ring:hover::after { opacity: 0.3; }

/* ── Checkbox Styling ── */
input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-strong);
    border-radius: 5px;
    background: var(--bg-input);
    cursor: pointer;
    position: relative;
    transition: all var(--duration-fast);
}
input[type="checkbox"]:checked {
    background: var(--primary-500);
    border-color: var(--primary-500);
}
input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: block !important;
    }
}
@media (min-width: 1025px) {
    .mobile-menu-btn {
        display: none !important;
    }
}
