/* ============================================================
   SEÇİM 2026 – FLIPBOOK (secim.php)
   ============================================================ */

/* ---------- Kitapçık listesi (/secim) ---------- */
.fb-shelf {
    max-width: 1100px;
    margin: 0 auto 80px;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
}

.fb-shelf-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    line-height: 1.4;
}

.fb-shelf-cover {
    display: block;
    width: 100%;
    max-width: 280px;
    margin-bottom: 14px;
    border-radius: 4px 8px 8px 4px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22), inset 3px 0 0 rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-origin: left center;
}

.fb-shelf-cover img {
    display: block;
    width: 100%;
    height: auto;
}

.fb-shelf-card:hover .fb-shelf-cover {
    transform: translateY(-6px) rotate(-1.2deg);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.fb-shelf-card strong {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.fb-shelf-card small {
    font-size: 13.5px;
    color: var(--text-light);
}

.fb-shelf-cta {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius);
    background: var(--red);
    color: #fff;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    transition: background var(--transition);
}

.fb-shelf-card:hover .fb-shelf-cta {
    background: var(--green);
}

@media (max-width: 768px) {
    .fb-shelf {
        grid-template-columns: 1fr;
        gap: 44px;
        margin-bottom: 56px;
    }
    .fb-shelf-cover { max-width: 230px; }
}

/* ---------- Görüntüleyici ---------- */
.fb-page {
    --fb-bg: #eceef1;
    --fb-ink: #1c1c1c;
    --fb-bar: #ffffff;
    --fb-bar-border: #e3e5e9;
    position: relative;
    background: var(--fb-bg);
    line-height: 1.4;
    margin-bottom: 64px; /* footer ile arada boşluk */
}

.fb-page.is-full { margin-bottom: 0; }

.fb-head {
    max-width: 1390px;
    margin: 0 auto;
    padding: 48px 30px 22px; /* header ile arada boşluk */
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    flex-wrap: wrap;
}

.fb-crumb {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-head);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--red);
}

.fb-crumb:hover { color: var(--green); }

.fb-head h1 {
    font-family: var(--font-head);
    font-size: 30px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--fb-ink);
}

.fb-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.fb-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--fb-bar-border);
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
    transition: all var(--transition);
}

.fb-tab i { font-size: 12px; color: var(--red); transition: color var(--transition); }

.fb-tab:hover { border-color: var(--red); color: var(--red); }

.fb-tab.active {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.fb-tab.active i { color: #fff; }

/* Sahne */
.fb-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 76px 22px;
    overflow: hidden;
    min-height: 300px;
}

.fb-book-wrap {
    position: relative;
    width: 100%;
    flex: 0 0 auto;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.26));
}

/* Tek başına duran kapak / arka kapak ortalansın */
.fb-book-wrap.is-cover { transform: translateX(-25%); }
.fb-book-wrap.is-back  { transform: translateX(25%); }

/* Kütüphane yüklenmeden önce: yalnızca kapak görünsün */
.fb-book:not(.stf__parent) {
    display: flex;
    justify-content: center;
}
.fb-book:not(.stf__parent) .fb-leaf { display: none; width: 50%; }
.fb-book:not(.stf__parent) .fb-leaf:first-child { display: block; }
.fb-book:not(.stf__parent) .fb-leaf img { position: static; height: auto; }

/* StPageFlip temel stilleri */
.stf__parent {
    position: relative;
    display: block;
    box-sizing: border-box;
    transform: translateZ(0);
    touch-action: pan-y;
}

.stf__wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.stf__block {
    position: absolute;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    perspective: 2000px;
}

.stf__item {
    display: none;
    position: absolute;
    transform-style: preserve-3d;
}

.stf__outerShadow,
.stf__innerShadow,
.stf__hardShadow,
.stf__hardInnerShadow {
    position: absolute;
    left: 0;
    top: 0;
}

.fb-leaf {
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Ccircle cx='22' cy='22' r='16' fill='none' stroke='%23d9dce1' stroke-width='4'/%3E%3Cpath d='M22 6a16 16 0 0 1 16 16' fill='none' stroke='%23B80E01' stroke-width='4' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 22 22' to='360 22 22' dur='0.9s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E") center / 44px no-repeat;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.fb-leaf img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: fill;
    pointer-events: none;
    -webkit-user-drag: none;
}

.fb-leaf img:not([src]) { visibility: hidden; }

/* Orta cilt gölgesi (çift sayfa görünümü) */
.stf__wrapper.--landscape .fb-leaf.--left::after,
.stf__wrapper.--landscape .fb-leaf.--right::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 7%;
    pointer-events: none;
}

.stf__wrapper.--landscape .fb-leaf.--left::after {
    right: 0;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0));
}

.stf__wrapper.--landscape .fb-leaf.--right::after {
    left: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0));
}

/* Yan oklar */
.fb-side {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--fb-bar-border);
    background: #fff;
    color: var(--fb-ink);
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transition: background var(--transition), color var(--transition), border-color var(--transition), opacity var(--transition);
    z-index: 5;
}

.fb-side-prev { left: 16px; }
.fb-side-next { right: 16px; }

.fb-side:hover:not(:disabled) {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.fb-side:disabled,
.fb-tb-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

/* Araç çubuğu */
.fb-toolbar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 9px 20px;
    background: var(--fb-bar);
    border-top: 1px solid var(--fb-bar-border);
}

.fb-tb-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.fb-tb-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--fb-ink);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}

.fb-tb-btn:hover:not(:disabled) {
    background: rgba(184, 14, 1, 0.09);
    color: var(--red);
}

.fb-tb-sep {
    width: 1px;
    height: 24px;
    margin: 0 6px;
    background: var(--fb-bar-border);
}

.fb-tb-progress {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 1 460px;
    min-width: 0;
}

.fb-tb-progress input[type="range"] {
    flex: 1;
    min-width: 0;
    accent-color: var(--red);
    cursor: pointer;
}

.fb-counter {
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 700;
    color: var(--fb-ink);
    white-space: nowrap;
    min-width: 74px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.fb-side:focus-visible,
.fb-tb-btn:focus-visible,
.fb-tab:focus-visible,
.fb-zoom-close:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

/* Tam ekran */
.fb-page.is-full {
    --fb-bg: #17181b;
    --fb-ink: #f2f2f2;
    --fb-bar: #202226;
    --fb-bar-border: #33363c;
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.fb-page.is-full .fb-head { display: none; }
.fb-page.is-full .fb-stage { flex: 1; padding-top: 18px; padding-bottom: 18px; }
.fb-page.is-full .fb-toolbar { position: static; }
.fb-page.is-full .fb-side { background: #2a2d32; border-color: #3a3d44; color: #f2f2f2; }
.fb-page.is-full .fb-tb-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); color: #fff; }
body.fb-lock { overflow: hidden; }

/* Yakınlaştırma katmanı */
.fb-zoom {
    position: fixed;
    inset: 0;
    z-index: 10010;
    background: rgba(14, 15, 17, 0.94);
    overflow: auto;
    display: none;
    cursor: zoom-out;
    -webkit-overflow-scrolling: touch;
}

.fb-zoom.active { display: block; }

.fb-zoom-inner {
    display: flex;
    justify-content: center;
    width: max-content;
    min-width: 100%;
    padding: 24px;
}

.fb-zoom-inner img {
    display: block;
    width: min(47vw, 1300px);
    height: auto;
    background: #fff;
}

.fb-zoom-inner.single img { width: min(92vw, 1300px); }

.fb-zoom-close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* Bilgi balonu */
.fb-toast {
    position: fixed;
    left: 50%;
    bottom: 84px;
    transform: translate(-50%, 12px);
    padding: 10px 18px;
    border-radius: 999px;
    background: #1c1c1c;
    color: #fff;
    font-size: 13.5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 10020;
}

.fb-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- Mobil ---------- */
@media (max-width: 768px) {
    .fb-head { padding: 28px 16px 14px; }
    .fb-page { margin-bottom: 40px; }
    .fb-head h1 { font-size: 23px; }
    .fb-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .fb-tabs::-webkit-scrollbar { display: none; }
    .fb-tab { padding: 8px 13px; font-size: 12.5px; }

    .fb-stage { padding: 6px 12px 16px; }
    .fb-side { display: none; }

    .fb-toolbar { gap: 4px; padding: 6px 8px; flex-wrap: wrap; }
    .fb-tb-progress { order: -1; flex: 1 1 100%; padding: 2px 8px 0; }
    .fb-tb-btn { width: 38px; height: 38px; }
    #fb-first, #fb-last { display: none; }
    .fb-tb-group:first-of-type { margin-right: auto; }

    .fb-zoom-inner { padding: 12px; }
    .fb-zoom-inner img,
    .fb-zoom-inner.single img { width: 210vw; max-width: 1300px; }
}

@media (prefers-reduced-motion: reduce) {
    .fb-book-wrap { transition: none; }
}
