/* ***************************************
   TEMA SİSTEMİ - CSS Custom Properties
   Light (varsayılan), Dark, Sepia
   *************************************** */

/* ─── Light Tema (varsayılan, dokunulmaz) ─── */
:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --header-bg: #dddddd;
    --header-text: #333333;
    --menu-bg: #cdcdcd;
    --menu-text: #333333;
    --card-bg: #ffffff;
    --card-border: #e0e0e0;
    --input-bg: #ffffff;
    --input-text: #333333;
    --input-border: rgba(34, 36, 38, .15);
    --link-color: #4183c4;
    --divider-color: rgba(34, 36, 38, .15);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --modal-bg: #ffffff;
    --modal-header-bg: #1b1c1d;
    --modal-header-text: #ffffff;
    --segment-bg: #ffffff;
    --kitap-listesi-hover: #f0e6c8;
}

/* ─── Dark Tema ─── */
html[theme="dark"] {
    --bg-color: #1a1a2e;
    --text-color: #e0e0e0;
    --header-bg: #16213e;
    --header-text: #e0e0e0;
    --menu-bg: #0f3460;
    --menu-text: #c8d6e5;
    --card-bg: #1e2a3a;
    --card-border: #2c3e50;
    --input-bg: #1e2a3a;
    --input-text: #e0e0e0;
    --input-border: #3a4a5a;
    --link-color: #6cb4ee;
    --divider-color: #2c3e50;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --modal-bg: #1e2a3a;
    --modal-header-bg: #0f3460;
    --modal-header-text: #e0e0e0;
    --segment-bg: #1e2a3a;
    --kitap-listesi-hover: #2c3e50;
}

/* ─── Sepia Tema ─── */
html[theme="sepia"] {
    --bg-color: #f4ecd8;
    --text-color: #5b4636;
    --header-bg: #d2b48c;
    --header-text: #3e2723;
    --menu-bg: #c9a96e;
    --menu-text: #3e2723;
    --card-bg: #faf0e1;
    --card-border: #c9a96e;
    --input-bg: #faf0e1;
    --input-text: #5b4636;
    --input-border: #c9a96e;
    --link-color: #8b5e3c;
    --divider-color: #c9a96e;
    --shadow-color: rgba(94, 59, 30, 0.15);
    --modal-bg: #faf0e1;
    --modal-header-bg: #6b4226;
    --modal-header-text: #f4ecd8;
    --segment-bg: #faf0e1;
    --kitap-listesi-hover: #e8d5a3;
}

/* ***************************************
   TEMA UYGULAMALARI
   Light temada dokunulmaz, diğerlerinde
   CSS custom properties ile override
   *************************************** */

/* Genel body ve arka plan */
html:not([theme="light"]) body,
html:not([theme="light"]) body.pushable,
html:not([theme="light"]) body.pushable>.pusher {
    background: var(--bg-color) !important;
    color: var(--text-color);
}

/* Header */
html:not([theme="light"]) div#header {
    background-color: var(--header-bg) !important;
    color: var(--header-text);
}

html:not([theme="light"]) div#header .item,
html:not([theme="light"]) #site-name {
    color: var(--header-text) !important;
}

/* Üst menü */
html:not([theme="light"]) div#ust-menu {
    background-color: var(--menu-bg) !important;
}

html:not([theme="light"]) div#ust-menu .item {
    color: var(--menu-text) !important;
}

/* Fomantic UI bileşenleri */
html:not([theme="light"]) .ui.menu {
    background: var(--header-bg);
    border-color: var(--divider-color);
}

html:not([theme="light"]) .ui.input>input,
html:not([theme="light"]) .ui.input input[type="text"] {
    background: var(--input-bg) !important;
    color: var(--input-text) !important;
    border-color: var(--input-border) !important;
}

html:not([theme="light"]) .ui.segment {
    background: var(--segment-bg);
    border-color: var(--divider-color);
    color: var(--text-color);
}

html:not([theme="light"]) .ui.modal {
    background: var(--modal-bg);
    color: var(--text-color);
}

html:not([theme="light"]) .ui.modal>.header {
    background: var(--modal-header-bg) !important;
    color: var(--modal-header-text) !important;
}

html:not([theme="light"]) .ui.modal>.content {
    background: var(--modal-bg);
    color: var(--text-color);
}

html:not([theme="light"]) .ui.header {
    color: var(--text-color);
}

html:not([theme="light"]) .ui.dividing.header {
    border-bottom-color: var(--divider-color);
}

html:not([theme="light"]) a {
    color: var(--link-color);
}

/* Kitap ekleme modalı */
html:not([theme="light"]) .kitap-listesi .kitap-sec-item {
    color: var(--text-color) !important;
}

html:not([theme="light"]) .kitap-listesi .kitap-sec-item:hover {
    background: var(--kitap-listesi-hover);
}

html:not([theme="light"]) .kitap-kategori-blok h4.ui.dividing.header {
    color: var(--text-color);
    border-bottom-color: var(--divider-color);
}

/* Layout container */
html:not([theme="light"]) .layout-container {
    color: var(--text-color);
}

/* Drupal mesaj ve formlar */
html:not([theme="light"]) .ui.form input,
html:not([theme="light"]) .ui.form textarea,
html:not([theme="light"]) .ui.form select {
    background: var(--input-bg);
    color: var(--input-text);
    border-color: var(--input-border);
}

/* Node içerik */
html:not([theme="light"]) .node__content {
    color: var(--text-color);
}

/* ***************************************
   TEMA DEĞİŞTİRİCİ BUTON STİLLERİ
   *************************************** */

.tema-degistirici {
    display: inline-flex;
    align-items: center;
    margin-right: 12px;
    position: relative;
}

.tema-degistirici-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tema-degistirici-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tema-degistirici-btn i {
    font-size: 16px;
    color: #333;
    transition: color 0.3s ease;
    margin: 0 !important;
}

/* Tema menüsü (dropdown) */
.tema-menusu {
    display: none;
    position: absolute;
    top: 44px;
    right: 0;
    background: var(--card-bg, #fff);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 8px;
    z-index: 1000;
    min-width: 180px;
    animation: temaMenuAc 0.2s ease-out;
}

.tema-menusu.visible {
    display: block;
}

@keyframes temaMenuAc {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tema-secenegi {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    background: none;
    width: 100%;
    font-size: 14px;
    font-family: serif;
    color: var(--text-color, #333);
}

.tema-secenegi:hover {
    background: rgba(0, 0, 0, 0.06);
}

.tema-secenegi.aktif {
    background: rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

.tema-renk-onizleme {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.tema-renk-onizleme.light {
    background: linear-gradient(135deg, #ffffff, #dddddd);
}

.tema-renk-onizleme.dark {
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
}

.tema-renk-onizleme.sepia {
    background: linear-gradient(135deg, #f4ecd8, #c9a96e);
}

.tema-secenegi-isim {
    flex: 1;
    text-align: left;
}

.tema-secenegi-tik {
    font-size: 14px;
    color: #4caf50;
    opacity: 0;
    transition: opacity 0.2s;
}

.tema-secenegi.aktif .tema-secenegi-tik {
    opacity: 1;
}

/* Dark tema için buton stilleri */
html[theme="dark"] .tema-degistirici-btn {
    background: rgba(30, 42, 58, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}

html[theme="dark"] .tema-degistirici-btn i {
    color: #e0e0e0;
}

html[theme="dark"] .tema-menusu {
    background: #1e2a3a;
    border: 1px solid #3a4a5a;
}

html[theme="dark"] .tema-secenegi {
    color: #e0e0e0;
}

html[theme="dark"] .tema-secenegi:hover {
    background: rgba(255, 255, 255, 0.08);
}

html[theme="dark"] .tema-secenegi.aktif {
    background: rgba(255, 255, 255, 0.12);
}

/* Sepia tema için buton stilleri */
html[theme="sepia"] .tema-degistirici-btn {
    background: rgba(250, 240, 225, 0.9);
    border-color: rgba(94, 59, 30, 0.2);
}

html[theme="sepia"] .tema-degistirici-btn i {
    color: #5b4636;
}

html[theme="sepia"] .tema-menusu {
    background: #faf0e1;
    border: 1px solid #c9a96e;
}

html[theme="sepia"] .tema-secenegi {
    color: #5b4636;
}

html[theme="sepia"] .tema-secenegi:hover {
    background: rgba(94, 59, 30, 0.08);
}

html[theme="sepia"] .tema-secenegi.aktif {
    background: rgba(94, 59, 30, 0.12);
}