/* Sitenin iskeleti (shell.js kurar): solda menü, ortada buzlu cam içerik sütunu, sağda keşfet paneli.
   Geniş ekranda menü yazılı; orta genişlikte yalnızca simge; dar ekranda sağ panel gizli;
   telefonda üst çubuk + alt menü + yuvarlak "Yaz" düğmesi. */

/* Cam paneller: arkadaki kitabın ne kadar görüneceği buradan ayarlanır.
   Cam açıldıkça soluk yazılar (--muted) kâğıtla karışmasın diye onlar da yeterince açık tutulur. */
:root {
    --glass: rgba(20, 17, 15, 0.28);       /* menü ve orta sütun */
    --glass-card: rgba(20, 17, 15, 0.36);  /* sağ paneldeki kartlar, arama kutusu */
    --glass-bar: rgba(20, 17, 15, 0.6);    /* sütunun yapışkan başlığı: altından yazılar kayar */
    --glass-blur: 6px;
    --muted: #ddd3c9;                      /* zaman, kitabın yazarı gibi ikincil yazılar */
    --text-lift: 0 1px 3px rgba(0, 0, 0, 0.55); /* cam ince olduğu için yazıların altına hafif gölge */
}

/* Cam panellerdeki yazılar arkadaki kitabın satırlarından ayrışsın */
.rail,
.column,
.side {
    text-shadow: var(--text-lift);
}

/* Düğmeler tarayıcıda gölgesiz gelir; panellerdekiler de gölgeyi alsın (altını çizme sayısı vb.) */
.rail button,
.column button,
.side button {
    text-shadow: inherit;
}

/* Altın düğmelerin koyu yazısında ve 3D kitabın kapağında gölge olmasın */
.rail-write,
.composer-btn,
.side .join-btn,
.book-scene {
    text-shadow: none;
}

/* iPhone'da çentik ve köşeler: sayfa (viewport-fit=cover ile) tüm ekranı kaplar, içerik güvenli alanda kalır */
body {
    padding: 0 env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
}

/* ---------------------------------------------------------------- Arka plan */

/* Kitap Arası: tüm ekranı kaplayan eski kitap sayfası (shell.js kurar). Sabit katmanda durur,
   tıklamaları engellemez. Canlı çizim yokken (telefonda) düz kâğıt rengi görünür. */
.paper-bg {
    --paper-dim: 0.5; /* perdenin koyuluğu: 0 = kâğıt olduğu gibi, 1 = tamamen karanlık */
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: #ecdfc4;
    pointer-events: none;
}

.paper-bg canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Kâğıt açık renkli; üstündeki koyu, sıcak perde açık renk yazıların okunmasını sağlar */
.paper-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(22, 16, 12, var(--paper-dim));
}

/* WebGL yoksa eski fotoğraf */
body.paper-off::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: linear-gradient(rgba(15, 13, 12, 0.55), rgba(15, 13, 12, 0.55)),
                      url('images/klara-bg.jpg');
    background-position: center center;
    background-size: cover;
    pointer-events: none;
}

.app {
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* Ekranda görünmez, ekran okuyucular okur */
.sr-only,
.tabbar .nav-label,
.fab .nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------------------------- Sol menü */

/* Menü de orta sütun gibi buzlu camın üstünde: arkadaki kitap sayfasının yazısıyla karışmasın */
.rail {
    position: sticky;
    top: 0;
    z-index: 30; /* hesap menüsü içerik sütununun üstünde açılsın */
    flex: 0 0 250px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 14px 16px 18px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    background-color: var(--glass);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
}

.rail-brand {
    align-self: flex-start;
    display: flex;
    margin-bottom: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    text-decoration: none;
    transition: background-color 0.2s;
}

/* Logo: kitap sitenin krem yazı renginde, yaprak altın vurgu renginde (orijinal koyu yeşil/kiremit
   koyu zeminde kaybolurdu); damar zeminin koyu kahvesi */
.logo {
    display: block;
    width: auto;
    height: 40px;
}

.logo-book {
    fill: #f0ece9;
}

.logo-leaf {
    fill: #deb878;
    transition: fill 0.2s;
}

.logo-vein {
    stroke: #2b221d;
}

.rail-brand:hover .logo-leaf,
.topbar-brand:hover .logo-leaf {
    fill: #e8c88e;
}

.rail-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rail-link {
    display: flex;
    align-items: center;
    gap: 16px;
    align-self: flex-start;
    padding: 11px 18px 11px 14px;
    border-radius: 999px;
    color: #e2d7cd;
    font-size: 1.12rem;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.rail-link svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.rail-brand:hover,
.rail-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

/* Bulunulan sayfa: kalın yazı, altın simge */
.rail-link[aria-current="page"] {
    color: #ffffff;
    font-weight: 600;
}

.rail-link[aria-current="page"] svg {
    color: #deb878;
}

/* Sohbetler simgesinin köşesindeki kırmızı sayı (yeni eşleşmeler, bekleyen istekler, okunmamış mesajlar) */
.rail-link,
.tabbar-link {
    position: relative;
}

.nav-badge {
    position: absolute;
    top: 4px;
    left: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background-color: #dc2626;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: none;
}

.tabbar-link .nav-badge {
    top: 2px;
    left: calc(50% + 4px);
}

/* Yeni bildirim gelince rozet kısa bir an büyür */
.nav-badge.pulse {
    animation: badge-pulse 0.9s ease-out 2;
}

@keyframes badge-pulse {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.35);
    }
    100% {
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-badge.pulse {
        animation: none;
    }
}

/* Yaz: altın renkli büyük düğme */
.rail-write {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    padding: 13px 18px;
    border-radius: 999px;
    background-color: #deb878;
    color: #1f1712;
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    transition: background-color 0.2s;
}

.rail-write svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.rail-write:hover,
.fab:hover,
.join-btn:hover {
    background-color: #e8c78d;
}

.rail-account {
    margin-top: auto;
}

.rail-login {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 16px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: none;
    color: #f0ece9;
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.rail-login svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.rail-login:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Hesap düğmesi ve menüsü */
.acct {
    position: relative;
}

.acct-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 999px;
    background: none;
    color: #ffffff;
    font: inherit;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

.acct-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Yöneticiye açık şikayet varsa avatarın köşesinde kırmızı nokta */
.acct-avatar {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.acct-avatar.alert::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background-color: #dc2626;
}

/* Şikayet et penceresi (giriş penceresinin görünümünü kullanır) */
.report-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: #ffffff;
}

.report-reasons {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border: none;
}

.auth-form label.report-reason {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 6px 6px;
    border-radius: 6px;
    font-size: 0.92rem;
    color: #f0ece9;
    cursor: pointer;
}

.auth-form label.report-reason:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.auth-form .report-reason input {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    accent-color: #deb878;
}

.report-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    font: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.report-input:focus-visible {
    outline: none;
    border-color: #d1c7be;
}

/* Okurun yanında "%78 uyumlusunuz" */
.compat-mini {
    color: #deb878;
    font-size: 0.78rem;
    font-weight: 600;
}

/* ---------------------------------------------------------------- Eşleştin! */

/* Konuşma isteği kabul edilince: kitap düşer (0.15 sn), kapağı açılır ve açılan kitap ortalanır (1 sn),
   sayfalarda iki okur ve sırtta kalp belirir (1.7 sn), kıvılcımlar saçılır, "Eşleştin!" yükselir (1.9 sn) */
.match-fx {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-shadow: none;
}

.match-fx.closing {
    animation: mfx-fade-out 0.25s ease-in both;
}

.mfx-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(74, 48, 30, 0.9), rgba(12, 9, 8, 0.95) 70%);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: mfx-fade 0.4s ease-out both;
}

/* Arkada süzülen 3D kitaplar (three.js); tıklamalar perdeye geçer */
.mfx-books {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    animation: mfx-fade 1.2s ease-out both;
}

.mfx-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 420px;
    text-align: center;
}

/* Kitap: --w genişlik. Kapak sol kenarından açılınca iki sayfa yan yana durur; kitap yarım genişlik kayarak ortalanır */
.mfx-book-wrap {
    --w: min(140px, 32vw);
    width: var(--w);
    height: calc(var(--w) * 1.45);
    perspective: 1200px;
    animation: mfx-center 0.9s ease-in-out 1.05s both;
}

.mfx-book {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: mfx-drop 0.85s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.15s both;
}

.mfx-cover {
    position: absolute;
    inset: 0;
    z-index: 2;
    transform-origin: left center;
    transform-style: preserve-3d;
    animation: mfx-open 1s cubic-bezier(0.6, 0.05, 0.3, 1) 1.05s both;
}

.mfx-face {
    position: absolute;
    inset: 0;
    overflow: hidden;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Ön kapak: kitabın gerçek kapağı; yoksa deri görünümlü kapakta kitabın adı */
.mfx-front {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border-radius: 3px 8px 8px 3px;
    background: linear-gradient(135deg, #5c2a22, #2b120e);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
    color: #f3e6c8;
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.mfx-front img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Kapağın içi (sol sayfa) ve alttaki sayfa (sağ sayfa): sırta doğru gölgelenen kâğıt */
.mfx-back,
.mfx-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    color: #3b2a1e;
}

.mfx-back {
    transform: rotateY(180deg);
    border-radius: 8px 3px 3px 8px;
    background: linear-gradient(270deg, #e6d6b8, #f8f0de 22%, #f8f0de);
}

.mfx-page {
    position: absolute;
    inset: 0;
    border-radius: 3px 8px 8px 3px;
    background: linear-gradient(90deg, #e6d6b8, #f8f0de 22%, #f8f0de);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.mfx-person {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    font-size: 0.82rem;
    font-weight: 600;
    animation: mfx-pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) 1.75s both;
}

.mfx-person-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sırtta, iki sayfanın arasına yukarıdan inen altın ayraç; indikten sonra hafifçe salınır */
.mfx-ribbon {
    position: absolute;
    top: -4px;
    left: 0;
    z-index: 3;
    width: 22px;
    height: 58%;
    margin-left: -11px;
    transform: translateZ(4px);
    overflow: hidden;
}

.mfx-ribbon svg {
    display: block;
    width: 100%;
    height: 100%;
    color: #deb878;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.4));
    transform-origin: top center;
    animation: mfx-ribbon-in 0.7s cubic-bezier(0.3, 1.3, 0.5, 1) 1.95s both, mfx-sway 3.2s ease-in-out 2.7s infinite;
}

@keyframes mfx-ribbon-in {
    from {
        transform: translateY(-100%);
    }
}

@keyframes mfx-sway {
    0%, 100% {
        transform: rotate(0deg);
    }
    30% {
        transform: rotate(2.5deg);
    }
    70% {
        transform: rotate(-2.5deg);
    }
}

/* Altın kıvılcımlar (yönleri JS'te rastgele: --x, --y; gecikme --d; büyüklük --s) */
.mfx-sparkles {
    position: absolute;
    top: 30%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
}

.mfx-sparkles span {
    position: absolute;
    width: 9px;
    height: 9px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff6d6, #deb878 55%, transparent 70%);
    opacity: 0;
    animation: mfx-spark 1.4s ease-out var(--d) both;
}

.mfx-title {
    margin: 28px 0 0;
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.2rem, 9vw, 3.2rem);
    line-height: 1.1;
    color: #deb878;
    text-shadow: 0 4px 24px rgba(222, 184, 120, 0.35);
    animation: mfx-rise 0.6s ease-out 1.95s both;
}

.mfx-sub {
    margin: 8px 0 0;
    color: #f0ece9;
    overflow-wrap: anywhere;
    animation: mfx-rise 0.6s ease-out 2.1s both;
}

/* "%78 uyumlusunuz" (yüklenince dolar; satırın yeri baştan ayrılır, düğmeler zıplamasın) */
.mfx-compat {
    min-height: 1.5em;
    margin: 6px 0 0;
    color: #deb878;
    font-weight: 600;
    animation: mfx-rise 0.6s ease-out 2.2s both;
}

.mfx-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    animation: mfx-rise 0.6s ease-out 2.25s both;
}

.mfx-go,
.mfx-later {
    display: inline-flex;
    align-items: center;
    padding: 11px 22px;
    border-radius: 999px;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mfx-go {
    border: none;
    background-color: #deb878;
    color: #1f1712;
}

.mfx-go:hover {
    background-color: #e8c78d;
}

/* Arkadan geçen kitapların üstünde de okunsun diye hafif koyu zemin */
.mfx-later {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(20, 14, 10, 0.65);
    color: #f0ece9;
}

.mfx-later:hover {
    background-color: rgba(60, 44, 34, 0.85);
}

.mfx-go:focus-visible,
.mfx-later:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(222, 184, 120, 0.5);
}

@keyframes mfx-fade {
    from {
        opacity: 0;
    }
}

@keyframes mfx-fade-out {
    to {
        opacity: 0;
    }
}

@keyframes mfx-drop {
    from {
        opacity: 0;
        transform: translateY(-60px) scale(0.35) rotateX(30deg) rotateZ(-10deg);
    }
}

@keyframes mfx-center {
    to {
        transform: translateX(calc(var(--w) / 2));
    }
}

/* Kapak alttaki sayfadan 1 piksel önde: aynı düzlemde titremesin */
@keyframes mfx-open {
    from {
        transform: translateZ(1px) rotateY(0deg);
    }
    to {
        transform: translateZ(1px) rotateY(-180deg);
    }
}

@keyframes mfx-pop {
    from {
        opacity: 0;
        transform: scale(0);
    }
}


@keyframes mfx-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

@keyframes mfx-spark {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0);
    }
    15% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--x), var(--y)) scale(var(--s));
    }
}

/* Hareketi azalt: animasyonsuz, doğrudan açık kitap */
@media (prefers-reduced-motion: reduce) {
    .match-fx *,
    .match-fx.closing {
        animation: none !important;
    }

    .mfx-book-wrap {
        transform: translateX(calc(var(--w) / 2));
    }

    .mfx-cover {
        transform: translateZ(1px) rotateY(-180deg);
    }

    .mfx-sparkles {
        display: none;
    }
}

/* Görünen ad, altında soluk @kullanıcıadı */
.acct-name {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.acct-display,
.acct-name .handle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.acct-display {
    font-weight: 600;
}

.acct-name .handle {
    font-size: 0.85rem;
}

.acct-more {
    display: flex;
    color: var(--muted);
}

.acct-more svg {
    width: 18px;
    height: 18px;
}

.acct-menu {
    position: absolute;
    z-index: 40;
    min-width: 190px;
    padding: 6px 0;
    background-color: #241d19;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

.acct-rail .acct-menu {
    bottom: calc(100% + 8px);
    left: 0;
}

.acct-top .acct-menu {
    top: calc(100% + 8px);
    right: 0;
}

.acct-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    color: #f0ece9;
    font: inherit;
    font-size: 0.95rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.acct-item:hover {
    background-color: rgba(255, 255, 255, 0.07);
}

.rail-brand:focus-visible,
.rail-link:focus-visible,
.rail-write:focus-visible,
.rail-login:focus-visible,
.acct-btn:focus-visible,
.acct-item:focus-visible,
.tabbar-link:focus-visible,
.topbar-brand:focus-visible,
.topbar-login:focus-visible,
.fab:focus-visible,
.join-btn:focus-visible,
.side-item:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(209, 199, 190, 0.6);
}

/* ---------------------------------------------------------------- Orta sütun */

.column {
    flex: 0 1 640px;
    min-width: 0;
    min-height: 100vh;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background-color: var(--glass);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
}

/* Sütunun üstüne yapışan başlık (sekmeler ya da sayfa adı); altından geçen içerik bulanıklaşır */
.column-head {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: var(--glass-bar);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.column-title {
    padding: 14px 20px;
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    line-height: 1.3;
    color: #ffffff;
}

.column-head .tabs {
    margin: 0;
    border-bottom: none;
}

.column-head .tabs button {
    text-shadow: none;
}

.column-foot {
    display: none;
    padding: 28px 20px 36px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--muted);
}

/* ---------------------------------------------------------------- Sağ panel */

.side {
    position: sticky;
    top: 0;
    align-self: flex-start;
    flex: 0 0 350px;
    max-height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 12px 0 24px 28px;
}

.side::-webkit-scrollbar {
    display: none;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background-color: var(--glass-card);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    color: var(--muted);
    transition: border-color 0.2s, color 0.2s;
}

.search-form:focus-within {
    border-color: #deb878;
    color: #deb878;
}

.search-form svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.search-form input {
    flex: 1;
    min-width: 0;
    border: none;
    background: none;
    color: #ffffff;
    font: inherit;
    font-size: 0.95rem;
    outline: none;
}

.search-form input::placeholder {
    color: var(--muted);
}

.search-results,
.side-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background-color: var(--glass-card);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
}

.search-results {
    margin-top: 8px;
    padding: 6px 0;
}

.search-group {
    padding: 8px 16px 2px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.search-empty {
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--muted);
}

.side-card {
    padding: 14px 0 8px;
}

.side-card[hidden],
.search-results[hidden] {
    display: none;
}

.side-title {
    padding: 0 16px 8px;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: #ffffff;
}

.side-text {
    padding: 0 16px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #d1c7be;
}

.join-btn {
    margin: 0 16px 8px;
    padding: 9px 20px;
    border: none;
    border-radius: 999px;
    background-color: #deb878;
    color: #1f1712;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.side-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.2s;
}

.side-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.side-cover {
    flex-shrink: 0;
    width: 32px;
    height: 48px;
    border-radius: 2px 3px 3px 2px;
    object-fit: cover;
    background: linear-gradient(135deg, #5a3e2e, #2a1c15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.side-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.side-name,
.side-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-name {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
}

.side-book .side-name {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
}

.side-meta {
    font-size: 0.8rem;
    color: var(--muted);
}

/* Telif yazısı kâğıdın üstünde durduğu için küçük bir cam zemin */
.side-foot {
    align-self: flex-start;
    padding: 6px 14px;
    border-radius: 999px;
    background-color: var(--glass-card);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    font-size: 0.8rem;
    color: var(--muted);
}

.foot-link {
    color: inherit;
    text-decoration: none;
}

.foot-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* ---------------------------------------------------------------- Telefon çubukları */

.topbar,
.tabbar,
.fab {
    display: none;
}

.topbar-brand {
    display: flex;
    padding: 2px;
    text-decoration: none;
    border-radius: 6px;
}

.topbar-brand .logo {
    height: 30px;
}

.topbar-login {
    background: none;
    border: none;
    color: #e2d7cd;
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}

.acct-top .acct-btn {
    padding: 0;
}

/* ---------------------------------------------------------------- Ekran genişliğine göre */

/* Orta genişlik: menüde yalnızca simgeler */
@media (max-width: 1279px) {
    .rail {
        flex-basis: 88px;
        align-items: center;
        padding: 14px 8px 18px;
    }

    .rail .nav-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .rail-brand {
        align-self: center;
        padding: 8px 10px;
    }

    .rail-brand .logo {
        height: 30px;
    }

    .rail-links {
        align-items: center;
    }

    .rail-link {
        align-self: center;
        padding: 12px;
    }

    .rail-write,
    .rail-login {
        width: 52px;
        height: 52px;
        padding: 0;
        justify-content: center;
    }

    .acct-rail .acct-btn {
        padding: 6px;
        justify-content: center;
    }

    .side {
        flex-basis: 320px;
        padding-left: 20px;
    }
}

/* Dar ekran: sağ panel yok, telif yazısı sütunun altında */
@media (max-width: 999px) {
    .side {
        display: none;
    }

    .column-foot {
        display: block;
    }
}

/* Telefon: soldaki menü yerine üst çubuk + alt menü */
@media (max-width: 699px) {
    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    }

    .rail {
        display: none;
    }

    .column {
        border: none;
    }

    .topbar {
        position: relative;
        z-index: 30;
        display: flex;
        align-items: center;
        justify-content: space-between;
        /* Ana ekrana eklenmiş uygulamada saat ve çentik çubuğun üstünde kalsın */
        padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
        background-color: rgba(20, 17, 15, 0.75);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 30;
        display: flex;
        justify-content: space-around;
        padding: 6px env(safe-area-inset-right, 0px) calc(6px + env(safe-area-inset-bottom, 0px)) env(safe-area-inset-left, 0px);
        background-color: rgba(20, 17, 15, 0.92);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .tabbar-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 64px;
        height: 44px;
        border-radius: 999px;
        color: #d1c7be;
    }

    .tabbar-link svg {
        width: 26px;
        height: 26px;
    }

    .tabbar-link[aria-current="page"] {
        color: #deb878;
    }

    .fab {
        position: fixed;
        right: calc(16px + env(safe-area-inset-right, 0px));
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        z-index: 31;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background-color: #deb878;
        color: #1f1712;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
        transition: background-color 0.2s;
    }

    .fab svg {
        width: 24px;
        height: 24px;
    }

    /* Bildirim alt menünün üstünde çıksın */
    .toast {
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    }
}
