/**
 * MT2PVP.TR — Karanlık mod katmanı (modern)
 * -------------------------------------------------------------
 * Aydınlık tema %85 CSS değişkeniyle kurulu olduğundan, karanlık mod
 * temelde renk token'larını (--color-*) tersine çevirerek elde edilir.
 * Değişken kullanmayan sabit beyaz yüzeyler ayrıca yamalanır.
 *
 * Etkinleşme koşulu: <html data-mode="dark">
 * Bu dosya her zaman yüklenir; karanlık kurallar data-mode="dark"
 * altında olduğundan aydınlık modda etkisizdir. Tema düğmesi ikon
 * mantığı ve geçiş animasyonları her iki modda da çalışır.
 */

/* ============================================================
   1) TEMA DÜĞMESİ (☀/🌙) — her iki modda geçerli
   ============================================================ */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 11px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-heading);
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.theme-toggle:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-1px);
}
.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    transition: opacity .2s ease, transform .35s ease;
}
/* Aydınlıkta ay (→ karanlığa geç), karanlıkta güneş (→ aydınlığa geç) */
html[data-mode="light"] .theme-toggle .sun-icon,
html:not([data-mode="dark"]) .theme-toggle .sun-icon { display: none; }
html[data-mode="light"] .theme-toggle .moon-icon,
html:not([data-mode="dark"]) .theme-toggle .moon-icon { display: inline-block; }
html[data-mode="dark"] .theme-toggle .moon-icon { display: none; }
html[data-mode="dark"] .theme-toggle .sun-icon { display: inline-block; transform: rotate(0deg); }

/* ============================================================
   2) MODLAR ARASI YUMUŞAK GEÇİŞ
   Mod boyanmadan önce ayarlandığı için ilk yüklemede tetiklenmez;
   yalnızca kullanıcı düğmeye bastığında animasyon oynar.
   ============================================================ */
body.mt2pvp-light-theme,
body.mt2pvp-light-theme .v2-navbar,
body.mt2pvp-light-theme .v2-header-shell,
body.mt2pvp-light-theme .footer,
body.mt2pvp-light-theme .v2-card,
body.mt2pvp-light-theme .mt2-card,
body.mt2pvp-light-theme .server-card {
    transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}

/* ============================================================
   3) KARANLIK PALET — token override
   ============================================================ */
html[data-mode="dark"] body.mt2pvp-light-theme {
    color-scheme: dark;

    --color-primary: #ff6f1f;
    --color-primary-hover: #ff8a45;
    --color-primary-soft: #2b1c11;
    --color-heading: #f3f5f9;
    --color-text: #b3bbc7;
    --color-muted: #808997;
    --color-background: #0e1116;
    --color-surface: #171b23;
    --color-border: #262d39;
    --color-success: #2ecc71;
    --color-success-soft: #12271b;
    --color-danger: #ff5b6a;
    --color-danger-soft: #2a161a;

    --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.40);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.48);
    --shadow-md: 0 18px 44px rgba(0, 0, 0, 0.55);

    /* İkincil (sabit tanımlı) token'lar */
    --mt2-bg-muted: #1e2530;
    --mt2-bg-chrome: #171b23;

    /* Yükseltilmiş yüzey (menü/dropdown) için yerel yardımcı */
    --dk-surface-2: #1d2430;
    --dk-surface-3: #232b38;

    background: var(--color-background);
    color: var(--color-text);
}

/* color-scheme'i html seviyesine de taşı (native form/scrollbar) */
html[data-mode="dark"] { color-scheme: dark; background: #0e1116; }

/* ============================================================
   4) SABİT BEYAZ YÜZEY YAMALARI
   ============================================================ */

/* --- Navbar / header --- */
html[data-mode="dark"] body.mt2pvp-light-theme .v2-navbar,
html[data-mode="dark"] body.mt2pvp-light-theme .v2-header-shell {
    background: var(--color-surface) !important;
    border-bottom-color: var(--color-border) !important;
}
html[data-mode="dark"] body.mt2pvp-light-theme .user-dropdown {
    background: var(--dk-surface-2) !important;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

/* Navbar arama kutusu */
html[data-mode="dark"] body.mt2pvp-light-theme .v2-navbar-search,
html[data-mode="dark"] body.mt2pvp-light-theme .v2-mobile-menu-search {
    background: var(--dk-surface-2);
    border-color: var(--color-border);
}
html[data-mode="dark"] body.mt2pvp-light-theme .v2-navbar-search input {
    background: transparent;
    color: var(--color-heading);
}

/* --- Mobil menü --- */
html[data-mode="dark"] body.mt2pvp-light-theme .v2-navbar-links,
html[data-mode="dark"] body.mt2pvp-light-theme .v2-mobile-menu-head,
html[data-mode="dark"] body.mt2pvp-light-theme .v2-mobile-menu-body,
html[data-mode="dark"] body.mt2pvp-light-theme .v2-mobile-menu-nav {
    background: var(--color-surface) !important;
    border-color: var(--color-border) !important;
}
html[data-mode="dark"] body.mt2pvp-light-theme .v2-nav-menu-fallback a,
html[data-mode="dark"] body.mt2pvp-light-theme .v2-mobile-menu-action-secondary {
    background: var(--dk-surface-2) !important;
    border-color: var(--color-border) !important;
    color: var(--color-heading) !important;
}
html[data-mode="dark"] body.mt2pvp-light-theme .v2-nav-menu-fallback a:hover {
    background: var(--color-primary-soft) !important;
    color: var(--color-primary) !important;
}

/* --- Footer --- */
html[data-mode="dark"] body.mt2pvp-light-theme .footer.footer-modern {
    background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-background) 100%) !important;
    border-top-color: var(--color-border) !important;
}
html[data-mode="dark"] body.mt2pvp-light-theme .footer-links-categories .footer-category-link {
    background: var(--dk-surface-2);
    border-color: var(--color-border);
}

/* --- Rehber hero --- */
html[data-mode="dark"] body.mt2pvp-light-theme .rehber-hero {
    background: linear-gradient(135deg, var(--color-surface) 0%, #1a1410 55%, #221812 100%);
    border-color: var(--color-border);
}
html[data-mode="dark"] body.mt2pvp-light-theme .rehber-hero-visual-media {
    background: linear-gradient(145deg, #221812 0%, #2b1c11 100%);
}

/* --- Spotlight / slider --- */
html[data-mode="dark"] body.mt2pvp-light-theme .mt2-spotlight-duo-col--premium {
    background: linear-gradient(180deg, var(--dk-surface-2) 0%, var(--color-surface) 100%);
}
html[data-mode="dark"] body.mt2pvp-light-theme .v2-slider-nav {
    background: var(--dk-surface-2) !important;
    border-color: var(--color-border);
    color: var(--color-heading);
}
html[data-mode="dark"] body.mt2pvp-light-theme .v2-slider-nav:hover {
    background: var(--color-primary) !important;
    color: #fff !important;
}

/* --- Marketplace / listeler / butonlar --- */
html[data-mode="dark"] body.mt2pvp-light-theme .v2-marketplace-empty,
html[data-mode="dark"] body.mt2pvp-light-theme .v2-see-all-btn,
html[data-mode="dark"] body.mt2pvp-light-theme .v2-upcoming-list {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}
html[data-mode="dark"] body.mt2pvp-light-theme .v2-marketplace-cta .v2-btn-outline {
    background: transparent !important;
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
}
html[data-mode="dark"] body.mt2pvp-light-theme .v2-marketplace-cta .v2-btn-outline:hover {
    background: var(--color-primary) !important;
    color: #fff !important;
}

/* --- Profil / server düzenleme tabloları --- */
html[data-mode="dark"] body.mt2pvp-light-theme .user-servers-table,
html[data-mode="dark"] body.mt2pvp-light-theme .server-edit-section select,
html[data-mode="dark"] body.mt2pvp-light-theme .server-edit-section .cancel-btn,
html[data-mode="dark"] body.mt2pvp-light-theme .profile-footer .back-link {
    background: var(--color-surface) !important;
    border-color: var(--color-border) !important;
    color: var(--color-heading) !important;
}

/* --- Rehber sınıf kartı sahneleri (dekoratif pastel → koyu tonlu) --- */
html[data-mode="dark"] body.mt2pvp-light-theme .rehber-class-card--savasci .rehber-class-scene { background: linear-gradient(160deg, #241416, #2a1013 55%, #201612) !important; }
html[data-mode="dark"] body.mt2pvp-light-theme .rehber-class-card--ninja .rehber-class-scene   { background: linear-gradient(160deg, #1c1826, #241b33 55%, #201612) !important; }
html[data-mode="dark"] body.mt2pvp-light-theme .rehber-class-card--sura .rehber-class-scene    { background: linear-gradient(160deg, #10202b, #12303f 55%, #201612) !important; }
html[data-mode="dark"] body.mt2pvp-light-theme .rehber-class-card--shaman .rehber-class-scene  { background: linear-gradient(160deg, #0f2116, #123021 55%, #201612) !important; }
html[data-mode="dark"] body.mt2pvp-light-theme .rehber-class-card--lycan .rehber-class-scene   { background: linear-gradient(160deg, #201612, #2b1c11 55%, #201612) !important; }
html[data-mode="dark"] body.mt2pvp-light-theme .rehber-class-card--sura .rehber-class-letter   { color: #38bdf8 !important; }
html[data-mode="dark"] body.mt2pvp-light-theme .rehber-class-card--shaman .rehber-class-letter { color: #4ade80 !important; }

/* ============================================================
   5) GENEL FORM ALANLARI (güvenli taban)
   ============================================================ */
html[data-mode="dark"] body.mt2pvp-light-theme :is(input, textarea, select):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]) {
    background: var(--dk-surface-2);
    color: var(--color-heading);
    border-color: var(--color-border);
}
html[data-mode="dark"] body.mt2pvp-light-theme :is(input, textarea, select)::placeholder {
    color: var(--color-muted);
}

/* ============================================================
   6) MODERN DOKUNUŞLAR
   ============================================================ */
/* Metin seçimi */
html[data-mode="dark"] body.mt2pvp-light-theme ::selection {
    background: rgba(255, 111, 31, 0.30);
    color: #fff;
}
/* Özel kaydırma çubuğu */
html[data-mode="dark"] body.mt2pvp-light-theme ::-webkit-scrollbar { width: 12px; height: 12px; }
html[data-mode="dark"] body.mt2pvp-light-theme ::-webkit-scrollbar-track { background: var(--color-background); }
html[data-mode="dark"] body.mt2pvp-light-theme ::-webkit-scrollbar-thumb {
    background: #2c3543;
    border: 3px solid var(--color-background);
    border-radius: 8px;
}
html[data-mode="dark"] body.mt2pvp-light-theme ::-webkit-scrollbar-thumb:hover { background: #3a4557; }
html[data-mode="dark"] body.mt2pvp-light-theme {
    scrollbar-color: #2c3543 var(--color-background);
    scrollbar-width: thin;
}
/* Kartlarda hafif kenar parlaması (derinlik) */
html[data-mode="dark"] body.mt2pvp-light-theme .v2-card,
html[data-mode="dark"] body.mt2pvp-light-theme .mt2-card,
html[data-mode="dark"] body.mt2pvp-light-theme .server-card {
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
/* Görselleri karanlıkta bir tık yumuşat */
html[data-mode="dark"] body.mt2pvp-light-theme .rehber-hero img,
html[data-mode="dark"] body.mt2pvp-light-theme .mt2-hero img {
    filter: brightness(0.94) contrast(1.02);
}
