/*
 * Ekin Sarrafiye — yatay TV ekranı.
 * Tasarım 1920×1080 sabit tuval üzerinedir; js/display-settings.js tuvali
 * ekrana sığacak biçimde ölçekler ve gerekirse döndürür. Ölçüler bu yüzden px'tir.
 */
:root {
    --bg: #0a0e13;
    --panel: #121922;
    --panel-2: #18212c;
    --line: rgba(217, 180, 90, 0.22);
    --line-soft: rgba(255, 255, 255, 0.07);
    --gold: #d9b45a;
    --gold-soft: #f0d898;
    --text: #f4f0e6;
    --muted: #98a3b0;
    --up: #3ecf8e;
    --down: #ff6b6b;
    --topbar: linear-gradient(90deg, #151d27, #10161e);
    --inset: rgba(0, 0, 0, 0.28);
    --glow: rgba(217, 180, 90, 0.10);
    --on-photo: #f4f0e6;
    --on-photo-muted: #c9c3b6;
    --on-photo-accent: #e2c170;
    --sans: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --serif: Georgia, "Times New Roman", serif;
}

/* Temalar: yönetim panelindeki "Renk teması" ayarı .screen[data-theme] değerini belirler. */
.screen[data-theme="light"] {
    --bg: #efe9dc;
    --panel: #fbf7ee;
    --panel-2: #f3ecdc;
    --line: rgba(140, 100, 20, 0.30);
    --line-soft: rgba(60, 45, 10, 0.12);
    --gold: #94660f;
    --gold-soft: #7a5206;
    --text: #1d1912;
    --muted: #6a6353;
    --up: #0c8a52;
    --down: #c8322f;
    --topbar: linear-gradient(90deg, #fbf7ee, #f3ecdc);
    --inset: rgba(140, 100, 20, 0.09);
    --glow: rgba(180, 130, 30, 0.14);
}
.screen[data-theme="navy"] {
    --bg: #081326;
    --panel: #0e1d38;
    --panel-2: #142848;
    --line: rgba(226, 193, 112, 0.26);
    --line-soft: rgba(255, 255, 255, 0.09);
    --gold: #e2c170;
    --gold-soft: #f5dfa4;
    --text: #f5f2ea;
    --muted: #9fb0cc;
    --topbar: linear-gradient(90deg, #132647, #0c1a33);
    --inset: rgba(0, 0, 0, 0.30);
    --glow: rgba(226, 193, 112, 0.10);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #000;
}

.screen {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 1920px;
    height: 1080px;
    transform: translate(-50%, -50%);
    transform-origin: center;
    display: grid;
    grid-template-rows: 70px minmax(0, 1fr) 26px;
    gap: 12px;
    padding: 14px;
    overflow: hidden;
    color: var(--text);
    font-family: var(--sans);
    font-variant-numeric: tabular-nums;
    background:
        radial-gradient(1200px 600px at 0% 0%, var(--glow), transparent 60%),
        var(--bg);
}

.panel {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
}

/* ---------- Üst bar ---------- */
.topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--topbar);
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--gold); }
.brand-mark { width: 48px; height: 48px; }
.brand-text { display: flex; align-items: baseline; gap: 12px; }
.brand-text strong {
    font-family: var(--serif);
    font-size: 38px;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--gold-soft);
}
.brand-text span { font-size: 17px; letter-spacing: 7px; color: var(--gold); }

.live-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px;
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1.5px;
    background: var(--inset);
}
.live-status .dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--up);
    box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.6);
    animation: pulse 2s infinite;
}
.live-status.is-error .dot { background: var(--down); animation: none; }
.live-status.is-error #market-status { color: var(--down); }
.last-update { display: flex; align-items: baseline; gap: 8px; padding-left: 14px; border-left: 1px solid var(--line-soft); }
.last-update-label { font-size: 12px; color: var(--muted); }
.last-update time { font-size: 18px; color: var(--gold-soft); }
@keyframes pulse {
    70% { box-shadow: 0 0 0 12px rgba(62, 207, 142, 0); }
    100% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0); }
}

.clock { display: flex; align-items: baseline; justify-content: flex-end; gap: 16px; }
.clock time { font-size: 40px; font-weight: 700; letter-spacing: 1px; }
.clock span { font-size: 17px; color: var(--muted); }

/* ---------- Ana yerleşim ---------- */
.main {
    display: grid;
    grid-template-columns: 850px minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
}
.right { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.bottom { flex: 1 1 0; display: flex; gap: 12px; min-height: 0; }
.side { flex: 1 1 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.side > .panel { flex: 1 1 0; }

/* Canlı yayın kapalıysa slayt büyür, yorum ve IBAN altta yan yana durur. */
.screen:not(.has-live) .bottom { flex-direction: column; }
.screen:not(.has-live) .hero { flex: 2.1 1 0; }
.screen:not(.has-live) .side { flex-direction: row; }
/* Slayt kapalıysa yorum ve IBAN yan yana durur. */
.screen:not(.has-slider) .hero { display: none; }
.screen:not(.has-slider) .side { flex-direction: row; }
.screen.no-reviews .review { display: none; }
/* Google yorumları kapalıyken IBAN, slaytın altında tam genişlikte yatay şerit olur. */
.screen.no-reviews.has-iban .bottom { flex-direction: column; }
.screen.no-reviews.has-iban .hero { flex: 1 1 0; }
.screen.no-reviews.has-iban .side { flex: 0 0 118px; flex-direction: row; }
.screen.no-reviews .iban-card { flex-direction: row; align-items: center; gap: 26px; padding: 10px 20px; }
.screen.no-reviews .iban-grid { align-self: stretch; align-items: center; gap: 22px; }
.screen.no-reviews .iban-rows { flex-direction: row; align-items: center; gap: 32px; }
.screen.no-reviews .ibanrow { display: flex; flex: 0 1 auto; flex-direction: column; gap: 3px; min-width: 0; }
.screen.no-reviews .ibanrow dd { font-size: 19px; }
.screen.no-reviews .iban-number-row { flex: 0 0 auto; margin-left: auto; }
.screen.no-reviews .ibanrow dd.code { font-size: 23px; white-space: nowrap; overflow: visible; }
.screen.no-reviews .iban-card .qr-panel { height: 100%; }
.screen.no-reviews .iban-card .qr-panel small { display: none; }
.screen.no-reviews.has-iban.has-live .hero-content h2 { font-size: 28px; }
.screen.no-reviews.has-iban.has-live .hero-copy { -webkit-line-clamp: 1; }
.screen.no-reviews:not(.has-iban) .side { display: none; }
.screen.no-reviews:not(.has-iban):not(.has-slider) .bottom { display: none; }
.screen.no-reviews:not(.has-iban):not(.has-slider).has-live .right { justify-content: center; }

/* ---------- Piyasa ---------- */
.market { padding: 12px; }
.marketbody { display: grid; gap: 10px; height: 100%; }
.cat { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.cathead { display: flex; align-items: center; justify-content: space-between; height: 30px; padding: 0 6px; }
.cathead strong {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--gold-soft);
}
.badge { font-size: 13px; font-weight: 600; letter-spacing: 2px; color: var(--muted); }
.cards {
    flex: 1 1 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(var(--card-rows, 1), minmax(0, 1fr));
    gap: 8px;
    min-height: 0;
}
.cards.is-single-currency { grid-template-columns: minmax(0, 1fr); }
.market-message {
    grid-column: 1 / -1;
    align-self: center;
    margin: 0;
    text-align: center;
    font-size: 20px;
    color: var(--muted);
}

.q {
    display: grid;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--panel-2);
}
.qi {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    color: var(--gold);
    background: var(--inset);
}
.qcopy { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.qn { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 23px; font-weight: 600; }
.qs { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; color: var(--muted); }
.price { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-width: 0; }
.pbox {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
    padding: 0 12px;
    border-radius: 9px;
    background: var(--inset);
    transition: background-color 0.8s;
}
.plabel { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; color: var(--muted); }
.buy, .sell { font-weight: 700; white-space: nowrap; }
.sellbox .sell { color: var(--gold-soft); }
.market-price-value { display: inline-flex; align-items: baseline; gap: 5px; }
.market-direction { font-size: 0.42em; transform: translateY(-0.35em); }
.price-up .market-direction { color: var(--up); }
.price-down .market-direction { color: var(--down); }
.pbox.price-changed-up { animation: flash-up 1.6s ease-out; }
.pbox.price-changed-down { animation: flash-down 1.6s ease-out; }
@keyframes flash-up { 0% { background: rgba(62, 207, 142, 0.38); } }
@keyframes flash-down { 0% { background: rgba(255, 107, 107, 0.38); } }

/* Altın kartı: üstte ad, altta büyük fiyatlar. */
.gold .q {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: center;
    gap: 6px 10px;
    padding: 9px 10px 10px;
}
.gold .price { grid-column: 1 / -1; align-self: stretch; }
.gold .pbox { align-items: center; }
.gold .buy, .gold .sell { font-size: 33px; }

/* Döviz kartı: tek satır. */
.fx .q {
    grid-template-columns: auto 132px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
}
.fx .qcopy { flex-direction: column; align-items: flex-start; gap: 0; }
.fx .qn { font-size: 21px; }
.fx .qs { font-size: 12px; letter-spacing: 1.5px; }
.fx .price { align-self: stretch; }
.fx .pbox { flex-direction: column; align-items: flex-end; justify-content: center; gap: 0; padding: 0 10px; }
.fx .plabel { font-size: 11px; }
.fx .buy, .fx .sell { font-size: 25px; }

.stale-banner {
    position: absolute;
    z-index: 3;
    left: 12px;
    right: 12px;
    bottom: 12px;
    margin: 0;
    padding: 12px 16px;
    border-radius: 10px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #1a0b0b;
    background: #ffb4a8;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.screen.is-stale .cards { opacity: 0.45; }

/* ---------- Canlı yayın ---------- */
.live { flex: 0 0 auto; aspect-ratio: 16 / 9; background: #000; }
.live-frame, .live-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Yayın dokunmatik/fare etkileşimine kapalıdır; yanlış dokunuş yayını durduramaz. */
.live-frame iframe { pointer-events: none; }
.live-message {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 40px;
    text-align: center;
    font-size: 24px;
    color: #98a3b0;
    background: #05070a;
}

/* ---------- Slayt ---------- */
.hero { flex: 1.2 1 0; color: var(--on-photo); background: #000; }
.hero-slides, .hero-slide { position: absolute; inset: 0; }
.hero-slide { opacity: 0; transition: opacity 1.2s ease; }
.hero-slide.active { opacity: 1; }
.hero-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(5, 7, 10, 0.88) 0%, rgba(5, 7, 10, 0.55) 48%, rgba(5, 7, 10, 0.05) 100%);
}
.hero-content {
    position: absolute;
    z-index: 1;
    inset: 0 34% 34px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 0 26px;
}
.hero-content .eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 3px; color: var(--on-photo-accent); }
.hero-content h2 { margin: 0; font-family: var(--serif); font-size: 36px; font-weight: 600; line-height: 1.12; }
.hero-copy {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.4;
    color: #d8d3c7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}
.hero-bottom {
    position: absolute;
    z-index: 2;
    left: 26px;
    right: 20px;
    bottom: 14px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    letter-spacing: 2px;
    color: var(--on-photo-muted);
}
.slide-number small { font-size: 1em; opacity: 0.7; }
.slider-progress { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.12); }
.slider-progress span { display: block; width: 0; height: 100%; background: var(--on-photo-accent); }
.slider-progress span.run { animation: slide-progress 6.8s linear forwards; }
@keyframes slide-progress { to { width: 100%; } }

/* ---------- Yorumlar ve IBAN ---------- */
.review, .iban-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2 { margin: 0; font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--gold-soft); white-space: nowrap; }
.rating { display: flex; align-items: baseline; gap: 8px; font-size: 15px; white-space: nowrap; }
.rating .stars { color: var(--gold); letter-spacing: 1px; }
.rating .score { font-size: 19px; font-weight: 700; }
.rating .count { color: var(--muted); }
.review-grid, .iban-grid { flex: 1 1 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; min-height: 0; }
.review-window { position: relative; min-height: 0; overflow: hidden; }
.review-message { margin: 0; font-size: 15px; line-height: 1.35; color: var(--muted); }
.review-track { display: grid; gap: 8px; height: 100%; transition: opacity 0.35s; }
.review-track.is-changing { opacity: 0; }
.review-entry { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 0; }
.reviewtext {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}
.side:not(:has(.iban-card:not([hidden]))) .reviewtext,
.screen:not(.has-live) .reviewtext,
.screen:not(.has-slider) .reviewtext { -webkit-line-clamp: 9; font-size: 18px; }
.review-meta { display: flex; align-items: baseline; gap: 10px; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.review-attribution { color: var(--gold); }
.reviewer { overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--text); text-decoration: none; }

.qr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 0;
    color: var(--muted);
    text-decoration: none;
}
.qr-panel img {
    flex: 0 1 auto;
    width: auto;
    height: 100%;
    min-height: 0;
    max-height: 150px;
    aspect-ratio: 1;
    border-radius: 6px;
    background: #fff;
    image-rendering: pixelated;
}
.qr-panel small { font-size: 12px; letter-spacing: 1px; white-space: nowrap; }
.qr-panel:not(:has(img:not([hidden]))) { display: none; }

.iban-rows { display: flex; flex-direction: column; justify-content: center; gap: 5px; margin: 0; min-width: 0; }
.ibanrow { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: baseline; gap: 8px; }
.ibanrow dt { font-size: 12px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.ibanrow dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 600; }
.iban-number-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
.ibanrow dd.code { font-size: 18px; letter-spacing: 0.5px; color: var(--gold-soft); white-space: normal; }

/* ---------- Alt bilgi ---------- */
.foot { display: flex; align-items: center; justify-content: center; font-size: 13px; letter-spacing: 2px; color: var(--muted); }

/* ---------- Müşteri hesaplama kartı ---------- */
.calculation-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 50px;
    background: rgba(3, 5, 8, 0.86);
}
.calculation-splash {
    display: flex;
    flex-direction: column;
    width: 1400px;
    max-height: 100%;
    padding: 40px 48px;
    border: 1px solid var(--gold);
    border-radius: 22px;
    background: var(--panel);
    box-shadow: 0 30px 120px rgba(0, 0, 0, 0.7);
}
.calculation-splash-header { text-align: center; }
.calculation-splash-header .eyebrow { margin: 0; font-size: 16px; letter-spacing: 4px; color: var(--gold); }
.calculation-splash-header h2 { margin: 10px 0 6px; font-family: var(--serif); font-size: 46px; font-weight: 600; color: var(--gold-soft); }
.calculation-splash-header p:last-child { margin: 0; font-size: 18px; color: var(--muted); }
.calculation-splash-table-wrap { flex: 1 1 auto; min-height: 0; margin: 26px 0; overflow: hidden; }
.calculation-splash-table { width: 100%; border-collapse: collapse; font-size: 26px; }
.calculation-splash-table th {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    font-size: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
}
.calculation-splash-table td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); text-align: right; }
.calculation-splash-table th:first-child, .calculation-splash-table td:first-child { text-align: left; font-weight: 600; }
.calculation-splash-table td:last-child { font-weight: 700; color: var(--gold-soft); }
.calculation-splash-subtitle { font-size: 0.65em; font-weight: 400; color: var(--muted); }
.calculation-splash-footer {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 18px;
    border-top: 2px solid var(--gold);
    font-size: 24px;
}
.calculation-splash-footer strong { font-size: 54px; color: var(--gold-soft); }
.calculation-splash-thanks { margin: 22px 0 0; text-align: center; font-family: var(--serif); font-size: 22px; font-style: italic; color: var(--muted); }
