/* ===========================================================
   PiyasaTakip — Ana stiller
   Bootstrap 5.3 data-bs-theme ile açık/koyu tema uyumlu.
   =========================================================== */
:root {
    --up-color: #16a34a;
    --up-bg: rgba(22, 163, 74, .12);
    --down-color: #dc2626;
    --down-bg: rgba(220, 38, 38, .12);
    --flat-color: #6b7280;
    --brand: #3b82f6;
}
[data-bs-theme="dark"] {
    --up-color: #22c55e;
    --down-color: #f87171;
    --flat-color: #9ca3af;
}

body { min-height: 100vh; }

/* Renk yardımcıları (fiyat yönü) */
.up   { color: var(--up-color)   !important; }
.down { color: var(--down-color) !important; }
.flat { color: var(--flat-color) !important; }

/* Fiyat güncelleme yanıp sönmesi */
@keyframes flashUp   { 0% { background: var(--up-bg);   } 100% { background: transparent; } }
@keyframes flashDown { 0% { background: var(--down-bg); } 100% { background: transparent; } }
.price-flash-up   { animation: flashUp .9s ease-out; border-radius: 4px; }
.price-flash-down { animation: flashDown .9s ease-out; border-radius: 4px; }

/* ---------------- Canlı fiyat şeridi ---------------- */
.market-ticker {
    background: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}
.ticker-track {
    display: flex;
    gap: 0;
    animation: tickerScroll 60s linear infinite;
    width: max-content;
}
.market-ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .9rem;
    text-decoration: none;
    color: var(--bs-body-color);
    font-size: .82rem;
    border-right: 1px solid var(--bs-border-color);
}
.ticker-item:hover { background: var(--bs-secondary-bg); }
.ti-sym { font-weight: 600; }
.ti-price { color: var(--bs-body-color); }

/* Şeride yeterince öğe yoksa kaydırmayı kapat */
.ticker-track.no-scroll { animation: none; }

/* ---------------- Navbar / Footer ---------------- */
.app-navbar { background: var(--bs-body-bg); z-index: 1030; }
.app-footer { background: var(--bs-tertiary-bg); }
.app-footer a { color: var(--bs-secondary-color); text-decoration: none; }
.app-footer a:hover { color: var(--brand); }
.disclaimer { color: var(--bs-secondary-color); border-left: 3px solid var(--bs-warning); padding-left: .6rem; }
.notif-badge { font-size: .6rem; position: absolute; top: 2px; right: 0; }

/* ---------------- Hero ---------------- */
.hero-banner {
    background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(59,130,246,.02));
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    padding: 2.2rem 1.8rem;
}

/* ---------------- Panel ---------------- */
.panel {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    padding: 1.1rem 1.2rem;
}
.panel.p-0 { padding: 0; overflow: hidden; }

/* ---------------- Ürün kartları ---------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .8rem;
}
.instrument-card {
    display: block;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .7rem;
    padding: .9rem 1rem;
    text-decoration: none;
    color: var(--bs-body-color);
    transition: transform .12s ease, border-color .12s ease;
}
.instrument-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.ic-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .15rem; }
.ic-symbol { font-weight: 700; font-size: 1.02rem; }
.ic-cat { font-size: .6rem; font-weight: 500; background: var(--bs-secondary-bg) !important; color: var(--bs-secondary-color) !important; }
.ic-name { font-size: .78rem; color: var(--bs-secondary-color); margin-bottom: .5rem; }
.ic-price { font-size: 1.15rem; font-weight: 600; }
.ic-change { font-size: .82rem; font-weight: 500; }

/* ---------------- Mini satırlar ---------------- */
.mini-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .2rem;
    border-bottom: 1px solid var(--bs-border-color);
    text-decoration: none;
    color: var(--bs-body-color);
    font-size: .9rem;
}
.mini-row:last-child { border-bottom: 0; }
.mini-row:hover { background: var(--bs-secondary-bg); }
.mini-post { padding: .55rem .2rem; border-bottom: 1px solid var(--bs-border-color); }
.mini-post:last-child { border-bottom: 0; }

/* ---------------- Piyasa tablosu ---------------- */
.market-table { font-size: .9rem; }
.market-table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--bs-secondary-color); }
.market-row { cursor: pointer; }
.market-tabs .nav-link { font-size: .85rem; padding: .35rem .8rem; }

/* ---------------- Ürün detay ---------------- */
.instrument-header .price-lg { font-size: 2rem; font-weight: 700; line-height: 1; }
.price-chg { font-size: 1rem; font-weight: 600; }
.stat-row .stat {
    background: var(--bs-tertiary-bg);
    border-radius: .5rem;
    padding: .5rem .7rem;
    display: flex; flex-direction: column;
}
.stat span { font-size: .7rem; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: .03em; }
.stat b { font-size: 1rem; }

/* Beklenti çubuğu */
.expectation-bar {
    display: flex; height: 22px; border-radius: 6px; overflow: hidden;
    background: var(--bs-tertiary-bg);
}
.exp-seg { height: 100%; }
.exp-seg.up   { background: var(--up-color); }
.exp-seg.flat { background: var(--flat-color); }
.exp-seg.down { background: var(--down-color); }

.price-chart { width: 100%; height: 360px; }

/* Beklenti / yorum kartları */
.post-item, .comment-item {
    padding: .7rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}
.post-item:last-child, .comment-item:last-child { border-bottom: 0; }

/* Embed kutusu */
.embed-code {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .4rem;
    padding: .6rem .7rem;
    font-size: .74rem;
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: .6rem;
}

/* Özet kartları (portföy) */
.stat-card { display: flex; flex-direction: column; gap: .1rem; }
.stat-card span { font-size: .72rem; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: .03em; }
.stat-card b { font-size: 1.3rem; }

/* ---------------- Bildirimler ---------------- */
.notif-row {
    display: flex; align-items: center; gap: .8rem;
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}
.notif-row:last-child { border-bottom: 0; }
.notif-row.unread { background: var(--bs-tertiary-bg); }
.notif-icon {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bs-secondary-bg);
    display: flex; align-items: center; justify-content: center;
    color: var(--brand); flex-shrink: 0;
}

/* ---------------- Profil ---------------- */
.avatar-lg {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; font-weight: 700; flex-shrink: 0;
}

/* ---------------- Kimlik doğrulama ekranı ---------------- */
.auth-body { display: flex; align-items: center; min-height: 100vh; background: var(--bs-tertiary-bg); }
.auth-wrap { width: 100%; max-width: 420px; margin: 2rem auto; padding: 0 1rem; }
.auth-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    padding: 2rem 1.8rem;
}
.auth-logo { font-size: 1.4rem; font-weight: 700; text-decoration: none; color: var(--bs-body-color); }

/* ---------------- Yönetim paneli ---------------- */
.admin-body { background: var(--bs-tertiary-bg); }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 240px; flex-shrink: 0;
    background: var(--bs-body-bg);
    border-right: 1px solid var(--bs-border-color);
    padding: 1rem .8rem;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-brand { font-weight: 700; padding: .5rem .6rem 1rem; display: flex; align-items: center; gap: .5rem; }
.admin-nav { display: flex; flex-direction: column; gap: .15rem; }
.admin-link {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .7rem; border-radius: .5rem;
    text-decoration: none; color: var(--bs-secondary-color);
    font-size: .9rem;
}
.admin-link:hover { background: var(--bs-secondary-bg); color: var(--bs-body-color); }
.admin-link.active { background: var(--brand); color: #fff; }
.admin-main { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.5rem; background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
}
.admin-content { padding: 1.5rem; flex-grow: 1; }

.admin-stat {
    display: block; text-align: center;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .7rem; padding: 1rem .6rem;
    color: var(--bs-body-color);
    transition: border-color .12s ease;
}
.admin-stat:hover { border-color: var(--brand); }
.as-icon { font-size: 1.5rem; }
.as-val { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.as-label { font-size: .74rem; color: var(--bs-secondary-color); }

.mod-item { border-left: 3px solid var(--bs-warning); }

/* ---------------- Duyarlı ---------------- */
@media (max-width: 991px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--bs-border-color); }
    .admin-nav { flex-direction: row; flex-wrap: wrap; }
    .price-chart { height: 300px; }
}
