/* ==========================================================================
   A&K POOLS - Açık / Koyu tema
   Varsayılan = açık. Tüm koyu kurallar [data-theme="dark"] altındadır.
   Bu dosya her sayfada ana stillerden SONRA yüklenir (inline stilleri de yener).
   ========================================================================== */

/* ---------- Ortak değişkenler ---------- */
[data-theme="dark"] {
    color-scheme: dark;

    /* landing.css */
    --blue: #60a5fa;
    --blue-dark: #3b82f6;
    --blue-light: rgba(59, 130, 246, .18);
    --ink: #e2e8f0;
    --muted: #94a3b8;
    --line: #24344a;
    --pool: #38bdf8;

    /* portal.css */
    --p: #38bdf8;
    --pd: #0ea5e9;
    --bg: #0b1220;
    --text: #e2e8f0;
    --border: #24344a;
    --ok: #4ade80;
    --warn: #fbbf24;

    /* admin.css */
    --primary: #38bdf8;
    --primary-dark: #0ea5e9;
    --card: #111c2e;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #38bdf8;
    --shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

/* ---------- Tema anahtarı (tüm paneller) ---------- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: rgba(255, 255, 255, .9);
    color: #0d47a1;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s, transform .2s;
    -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover { transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
[data-theme="dark"] .theme-toggle {
    background: #1b2941;
    color: #fbbf24;
    border-color: #334155;
}
[data-theme="dark"] .theme-toggle:hover { background: #243754; }
.theme-toggle-fixed { position: fixed; top: 16px; right: 16px; z-index: 200; }
.login-lang { gap: 8px; }

/* ==========================================================================
   LANDING / YASAL SAYFALAR
   ========================================================================== */
[data-theme="dark"] body {
    background: #0b1220;
    color: #e2e8f0;
}
[data-theme="dark"] .nav { background: rgba(11, 18, 32, .94); }
[data-theme="dark"] .nav-links a.link { color: #94a3b8; }
[data-theme="dark"] .nav-links a.link:hover { color: #60a5fa; }
[data-theme="dark"] .lang-btn { background: #111c2e; color: #94a3b8; border-color: #334155; }
[data-theme="dark"] .lang-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }

[data-theme="dark"] .hero {
    background:
        radial-gradient(1100px 520px at 85% -10%, rgba(37, 99, 235, .20), transparent),
        radial-gradient(900px 480px at 0% 0%, rgba(14, 165, 233, .14), transparent),
        linear-gradient(180deg, #0b1220, #0f1c31);
}
[data-theme="dark"] .hero h1 .accent { color: #60a5fa; }
[data-theme="dark"] .hero-badge { background: rgba(37, 99, 235, .18); color: #bfdbfe; }
[data-theme="dark"] .hero p.lead,
[data-theme="dark"] .sec-title p,
[data-theme="dark"] .hero-stats .stat span { color: #94a3b8; }
[data-theme="dark"] .hero-stats .stat b { color: #60a5fa; }
[data-theme="dark"] .btn-white { background: #111c2e; color: #bfdbfe; }
[data-theme="dark"] .btn-white:hover { background: #1b2941; }

[data-theme="dark"] .feature-card,
[data-theme="dark"] .contact-card,
[data-theme="dark"] .step { background: #111c2e; border-color: #24344a; box-shadow: none; }
[data-theme="dark"] .feature-card .ic { background: rgba(37, 99, 235, .18); color: #bfdbfe; }
[data-theme="dark"] .step p { color: #94a3b8; }
[data-theme="dark"] .contact-section { background: #0e1729; }
[data-theme="dark"] .contact-card input,
[data-theme="dark"] .contact-card textarea {
    background: #0b1220; color: #e2e8f0; border-color: #334155;
}
[data-theme="dark"] .contact-ok { background: rgba(22, 163, 74, .18); color: #86efac; }
[data-theme="dark"] .contact-err { background: rgba(220, 38, 38, .18); color: #fca5a5; }
[data-theme="dark"] .nav-links,
[data-theme="dark"] .nav-actions.mobile-open { background: #0f1c31; border-color: #24344a; }
/* Mobil menü JS'i açık renkli inline stil yazdığı için koyu temada zorla eziyoruz. */
[data-theme="dark"] .nav-actions[style*="background"] { background: #0f1c31 !important; border-color: #24344a !important; }
[data-theme="dark"] .nav-links a.link { border-color: #24344a; }
[data-theme="dark"] footer { background: #070d18; }

/* yasal sayfaların inline stilleri */
[data-theme="dark"] .legal-card { background: #111c2e; border-color: #24344a; box-shadow: none; }
[data-theme="dark"] .legal-card h1,
[data-theme="dark"] .legal-card .body h2,
[data-theme="dark"] .legal-card .body h3,
[data-theme="dark"] .legal-card .body a,
[data-theme="dark"] .legal-links a,
[data-theme="dark"] .back-home { color: #7dd3fc; }
[data-theme="dark"] .legal-card .updated,
[data-theme="dark"] .legal-card .body,
[data-theme="dark"] .legal-card .lead,
[data-theme="dark"] .delete-form label,
[data-theme="dark"] .delete-form .hint { color: #a8b8cc; }
[data-theme="dark"] .legal-tabs a { background: #111c2e; color: #7dd3fc; border-color: #334155; }
[data-theme="dark"] .legal-tabs a.active { background: #2563eb; color: #fff; border-color: #2563eb; }
[data-theme="dark"] .delete-form input { background: #0b1220; color: #e2e8f0; border-color: #334155; }
[data-theme="dark"] .alert-error { background: rgba(153, 27, 27, .22); border-color: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .alert-success { background: rgba(6, 95, 70, .25); border-color: #065f46; color: #6ee7b7; }
[data-theme="dark"] .err-wrap { background: linear-gradient(135deg, #0b1220, #152a44); }
[data-theme="dark"] .err-card { background: #111c2e; color: #e2e8f0; }
[data-theme="dark"] .err-code { color: #60a5fa; }
[data-theme="dark"] .err-card h1 { color: #e2e8f0; }
[data-theme="dark"] .err-card p { color: #94a3b8; }
[data-theme="dark"] .err-count { color: #7dd3fc; }

/* ==========================================================================
   MÜŞTERİ / PERSONEL PORTALI
   ========================================================================== */
[data-theme="dark"] .portal-top { background: #111c2e; }
[data-theme="dark"] .portal-side { background: #0d1b2e; color: #cbd5e1; }
[data-theme="dark"] .portal-side a:hover,
[data-theme="dark"] .portal-side a.active { background: #173a55; color: #fff; }
[data-theme="dark"] .stat-card,
[data-theme="dark"] .card { background: #111c2e; border-color: #24344a; }
[data-theme="dark"] th,
[data-theme="dark"] td { border-bottom-color: #24344a; }
[data-theme="dark"] .badge { background: rgba(56, 189, 248, .15); color: #7dd3fc; }
[data-theme="dark"] .badge.completed { background: rgba(34, 197, 94, .16); color: #86efac; }
[data-theme="dark"] .badge.cancelled { background: rgba(239, 68, 68, .16); color: #fca5a5; }
[data-theme="dark"] .badge.on_the_way { background: rgba(245, 158, 11, .16); color: #fcd34d; }
[data-theme="dark"] .badge.arrived { background: rgba(59, 130, 246, .16); color: #93c5fd; }
[data-theme="dark"] .badge.in_progress { background: rgba(56, 189, 248, .15); color: #7dd3fc; }
[data-theme="dark"] .badge.cleaning { background: rgba(168, 85, 247, .16); color: #d8b4fe; }
[data-theme="dark"] .badge.pending { background: rgba(148, 163, 184, .16); color: #cbd5e1; }
[data-theme="dark"] .portal-btn.secondary { background: #1e2f48; color: #cbd5e1; }
[data-theme="dark"] .profile-grid div { background: #0e1a2b; }
[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: #0b1220; color: #e2e8f0; border-color: #334155;
}

/* ==========================================================================
   ADMIN PANELİ
   ========================================================================== */
[data-theme="dark"] .topbar { background: #111c2e; }
[data-theme="dark"] table th,
[data-theme="dark"] table tr:hover { background: #131f33; }
[data-theme="dark"] .form-group label { color: #cbd5e1; }
[data-theme="dark"] .form-control { background: #0b1220; color: #e2e8f0; border-color: #334155; }
[data-theme="dark"] .alert-success { background: rgba(39, 174, 96, .16); color: #86efac; border-color: rgba(39, 174, 96, .35); }
[data-theme="dark"] .alert-danger { background: rgba(231, 76, 60, .16); color: #fca5a5; border-color: rgba(231, 76, 60, .35); }
[data-theme="dark"] .alert-warning { background: rgba(243, 156, 18, .16); color: #fcd34d; border-color: rgba(243, 156, 18, .35); }
[data-theme="dark"] .alert-info { background: rgba(52, 152, 219, .16); color: #7dd3fc; border-color: rgba(52, 152, 219, .35); }
[data-theme="dark"] .modal { background: #111c2e; color: #e2e8f0; }
[data-theme="dark"] .progress { background: #1e2f48; }
[data-theme="dark"] .status-pending { background: rgba(148, 163, 184, .18); color: #cbd5e1; }
[data-theme="dark"] .status-in_progress { background: rgba(59, 130, 246, .18); color: #93c5fd; }
[data-theme="dark"] .status-on_the_way { background: rgba(249, 115, 22, .18); color: #fdba74; }
[data-theme="dark"] .status-arrived { background: rgba(234, 179, 8, .18); color: #fde047; }
[data-theme="dark"] .status-cleaning { background: rgba(168, 85, 247, .18); color: #d8b4fe; }
[data-theme="dark"] .status-completed { background: rgba(34, 197, 94, .18); color: #86efac; }
[data-theme="dark"] .status-cancelled { background: rgba(239, 68, 68, .18); color: #fca5a5; }
[data-theme="dark"] .login-card { background: #111c2e; color: #e2e8f0; }

/* Küçük ekranlarda anahtarın üst bara sığması */
@media (max-width: 720px) {
    .nav-inner .theme-toggle { width: 32px; height: 32px; margin-left: 8px; }
    .portal-user .theme-toggle { width: 30px; height: 30px; }
}
