:root {
    --bg-main: #020617;
    --bg-sidebar: #0f172a;     
    --bg-card: #1e293b;        
    --bg-card-hover: #334155;  
    --text-main: #f8fafc;      
    --text-muted: #94a3b8;     
    --accent-btc: #f59e0b;     
    --green: #10b981;          
    --red: #ef4444;
    --grey: #64748b;
    --font-stack: 'Inter', system-ui, sans-serif;
    --sidebar-width: 360px;
}

body { margin: 0; background-color: var(--bg-main); font-family: var(--font-stack); color: var(--text-main); overflow: hidden; }

/* SIDEBAR & MOBİL UYUM */
.crypto-sidebar {
    position: fixed; top: 0; right: 0; width: var(--sidebar-width); height: 100vh;
    background-color: var(--bg-sidebar); border-left: 1px solid rgba(255, 255, 255, 0.08);
    display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0,0,0,0.5); z-index: 9000;
}

@media (max-width: 768px) {
    .main-content-placeholder { display: none; } 
    .crypto-sidebar { width: 100%; border-left: none; position: static; height: 100vh; }
    body { overflow: auto; background-color: var(--bg-sidebar); }
}

.sidebar-header { padding: 20px 24px 15px 24px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sidebar-title { margin: 0; font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.header-count { font-size: 0.8rem; color: var(--text-muted); background: rgba(255,255,255,0.05); padding: 2px 6px; border-radius: 4px; }
.average-badge { font-size: 0.8rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; background: rgba(255,255,255,0.05); min-width: 50px; text-align: center; }

/* ARAMA */
.search-box { position: relative; width: 100%; }
.search-box input { width: 100%; background: #020617; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; padding: 10px 12px 10px 36px; color: var(--text-main); font-family: var(--font-stack); font-size: 0.9rem; box-sizing: border-box; transition: all 0.2s; }
.search-box input:focus { outline: none; border-color: var(--accent-btc); background: #020617; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

.suggestions-list { position: absolute; top: 110%; left: 0; width: 100%; background: #1e293b; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; list-style: none; margin: 0; padding: 5px 0; box-shadow: 0 10px 30px rgba(0,0,0,0.8); z-index: 9999; display: none; max-height: 200px; overflow-y: auto; }
.suggestions-list.active { display: block; }
.suggestion-item { padding: 12px 15px; cursor: pointer; display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); border-bottom: 1px solid rgba(255,255,255,0.02); }
.suggestion-item:hover { background: rgba(255,255,255,0.05); color: #fff; }

/* ÜST BAR (İTTİRME EFEKTLİ) */
.score-section { padding: 20px; background: rgba(0,0,0,0.1); border-bottom: 1px solid rgba(255,255,255,0.05); }
.score-info-top { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.8rem; }
.info-label { color: var(--text-muted); }
.score-ge { font-weight: 700; }
.push-bar-container { height: 10px; background: #334155; border-radius: 6px; overflow: hidden; display: flex; position: relative; }
.push-segment { height: 100%; transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.push-segment.negative { background: var(--red); }
.push-segment.positive { background: var(--green); }
.center-marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: #fff; transform: translateX(-50%); opacity: 0.5; z-index: 2; }
.meter-labels { display: flex; justify-content: space-between; margin-top: 5px; font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; }

/* HABERLER */
.news-scroll-area { flex-grow: 1; overflow-y: auto; padding: 15px; -webkit-overflow-scrolling: touch; }
.news-scroll-area::-webkit-scrollbar { width: 6px; }
.news-scroll-area::-webkit-scrollbar-track { background: transparent; }
.news-scroll-area::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }
.news-item { background: var(--bg-card); padding: 16px; border-radius: 12px; margin-bottom: 12px; border: 1px solid rgba(255,255,255,0.03); transition: transform 0.2s, background 0.2s; cursor: pointer; }
.news-item:active { transform: scale(0.98); } 
.news-item:hover { background: var(--bg-card-hover); border-color: rgba(255,255,255,0.1); }
.item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.coin-tag { font-size: 0.7rem; font-weight: 800; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; margin-right: 8px; display: inline-block; letter-spacing: 0.5px; }
.tag-btc { background: rgba(245, 158, 11, 0.2); color: var(--accent-btc); }
.tag-eth { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.tag-alt { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.tag-pepe { background: rgba(76, 175, 80, 0.2); color: #4caf50; } 
.item-score { font-size: 1.1rem; font-weight: 800; line-height: 1; }
.news-title-text { display: block; color: #fff; font-size: 0.95rem; font-weight: 500; line-height: 1.4; margin-bottom: 10px; }
.news-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; }

.news-ad-slot {
  margin: 6px 0 14px;
  padding: 10px 0;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
  border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
  display: block;
}

/* 0 MERKEZLİ BAR */
.bidirectional-bar-bg {
    width: 80px; height: 6px; background: #334155; border-radius: 3px; position: relative; overflow: hidden;
}
.bidirectional-center {
    position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: #fff; transform: translateX(-50%); z-index: 5; opacity: 0.5;
}
.bidirectional-fill { height: 100%; position: absolute; top: 0; transition: all 0.3s; }

.news-time-ago { display: block; font-size: 0.75rem; color: #64748b; font-style: italic; margin-top: 10px; text-align: right; transition: color 0.3s; }

/* SİLİNME UYARISI STİLİ */
.text-danger-blink {
    color: #ef4444 !important;
    font-weight: 700;
    animation: blinkText 1s infinite;
}
@keyframes blinkText { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }

/* FOOTER */
.sidebar-footer { padding: 15px 20px; font-size: 0.75rem; color: var(--text-muted); border-top: 1px solid rgba(255,255,255,0.05); background: var(--bg-sidebar); }
.footer-info { display: flex; justify-content: space-between; align-items: center; }
.footer-stat-group { display: flex; align-items: center; gap: 8px; }
.stat-number { color: #fff; font-weight: 800; font-size: 0.9rem; }
.footer-time-group { background: rgba(255,255,255,0.05); padding: 4px 10px; border-radius: 4px; }

/* LOADING */
.loader-container { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 0; }
.spinner { width: 30px; height: 30px; border: 3px solid rgba(255,255,255,0.1); border-radius: 50%; border-top-color: var(--accent-btc); animation: spin 1s ease-in-out infinite; margin-bottom: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 0.85rem; color: var(--text-muted); }

/* MODAL — SAĞ ALT TOAST STİLİ */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;              /* başta kapalı */
  justify-content: flex-end;  /* sağa yasla */
  align-items: flex-end;      /* alta yasla */
  padding: 24px 32px;         /* kenarlardan içeri al */
  background: transparent;    /* ZEMİN KARARMA YOK */
  pointer-events: none;       /* sadece içerik tıklanabilir olacak */
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.modal-overlay.active {
  display: flex;
  pointer-events: auto;       /* aktifken tıklanabilir */
  opacity: 1;
}

.modal-content {
  position: relative;
  width: 360px;
  max-width: 100%;
  background: #020617;        /* panel ana tonu */
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.7);
  padding: 18px 18px 14px;
  border: 1px solid rgba(148,163,184,0.45);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.22s ease-out, opacity 0.22s ease-out;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
  opacity: 1;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(15,23,42,0.9);
  border: none;
  color: #e5e7eb;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(30,64,175,0.95);
  color: #fff;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.modal-title {
  margin: 0 0 8px 0;
  font-size: 1rem;
  line-height: 1.4;
  color: #f9fafb;
}

.modal-body {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #cbd5e1;
  margin-bottom: 12px;
  max-height: 150px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(148,163,184,0.25);
  padding-top: 10px;
  margin-top: 6px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.modal-read-btn {
  background: #e5e7eb;
  color: #020617;
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8rem;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.modal-read-btn:hover {
  background: #f9fafb;
}

/* ==== KRİPTO HABER ENTEGRASYON DÜZELTMELERİ ==== */

/* Haber kartı, sağ kolonda F&G'nin ALTINDA tam genişlikte dursun */
.col-status .news-card {
  margin-top: 16px;   /* F&G ile araya nefes payı */
  width: 100%;
}

/* Eski "sabit sağ sidebar" davranışını iptal et */
.col-status .news-card .crypto-sidebar {
  position: static;   /* fixed/absolute ne varsa ez */
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: 100%;
  height: auto;
  max-height: 600px;  /* çok aşağı taşmasın, içeride scroll açılsın */
  box-shadow: none;   /* panelin kendi kart gölgesi yeterli, istersen sil */
}

/* Haber listesi kendi içinde scroll yapsın, kart boyu sabit kalsın */
.col-status .news-card .news-scroll-area {
  max-height: 360px;  /* gerekirse 260 / 300 oynarız */
  overflow-y: auto;
}

/* Sağ kolonun diğer kolonlarla aynı hizada bitmesi için gerilmeyi eşitle */
.main-grid {
  align-items: stretch;
}

/* ==== PANEL İÇİ HABER BAR İNCELTME ==== */

/* Her bir haber kartını incelt */
.col-status .news-card .news-item {
  padding: 8px 12px;      /* 16px'ten 8px'e düştü */
  margin-bottom: 8px;     /* 12px -> 8px */
  border-radius: 10px;    /* 12px yerine biraz daha sıkı */
}

/* Başlığı küçült, daha kompakt yap */
.col-status .news-card .news-title-text {
  font-size: 0.88rem;     /* 0.95 -> 0.88 */
  margin-bottom: 6px;     /* 10 -> 6 */
  line-height: 1.3;
}

/* Alt satır (zaman, etki vs.) daha küçük ve sıkı */
.col-status .news-card .news-meta {
  font-size: 0.7rem;      /* 0.75 -> 0.7 */
}

/* Zaman bilgisi de çok yer kaplamasın */
.col-status .news-card .news-time-ago {
  font-size: 0.7rem;      /* 0.75 -> 0.7 */
  margin-top: 6px;        /* 10 -> 6 */
}

/* F&G kartı ile Kripto Haber kartı arasındaki boşluğu azalt */
.col-status .news-card {
  margin-top: 2px;   /* 16 yaptıysan veya default neyse, bunu 8'e çekiyoruz */
}

/* ==== Kripto Haber üst bölüm inceltme ==== */

/* Üst header bölümünü sıkıştır */
.col-status .news-card .sidebar-header {
  padding: 8px 12px 6px;   /* daha önceki geniş padding'i daraltıyoruz */
}

/* Başlık satırı + sayaç arası boşluk */
.col-status .news-card .sidebar-header .header-top {
  margin-bottom: 6px;      /* 10–12 civarındaysa 6'ya düşürüyoruz */
}

/* Arama kutusunun üst/alt boşluğunu kıs */
.col-status .news-card .search-box {
  margin-top: 4px;
  margin-bottom: 6px;      /* eskiye göre daha dar */
}

/* Genel Piyasa Dengesi bloğunu incelt */
.col-status .news-card .score-section {
  padding: 8px 12px;       /* üst/alt padding küçüldü */
  margin-bottom: 8px;
}

.col-status .news-card .score-info-top {
  margin-bottom: 4px;
}

.col-status .news-card .push-bar-container {
  margin: 4px 0;
}

.col-status .news-card .meter-labels {
  margin-top: 2px;
}

.news-day-separator{
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  margin: 8px 0 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(148,163,184,0.35);
}

/* Haber toast renk çizgisi */
.toast-accent {
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 100%;
  border-radius: 18px 0 0 18px;
}
.toast-btc { background: #fbbf24; }   /* amber */
.toast-eth { background: #a855f7; }   /* mor */
.toast-alt { background: #22d3ee; }   /* cyan */
.toast-meme { background: #4ade80; }  /* yeşil */

/* ===== NEWS PORTAL — LIGHT THEME: alttaki mavi sızıntıyı kapat ===== */
body.light-theme .news-panel,
body.light-theme #news-panel,
body.light-theme .crypto-news,
body.light-theme .news-wrap,
body.light-theme .news-container,
body.light-theme .news-list,
body.light-theme .news-scroll{
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

/* Eğer haber alanının dış kabı ayrıysa (genelde sağ kolonda) */
body.light-theme .right-news,
body.light-theme .sidebar-news,
body.light-theme .news-card-wrap{
  background: #f6f8fc !important;
}
/* ===== LIGHT THEME: Haber portalı arka plan sızıntısını kapat ===== */

/* 1) Haber portalının bulunduğu tüm olası kapsayıcılar */
body.light-theme #news-panel,
body.light-theme .news-panel,
body.light-theme .crypto-news,
body.light-theme .news-wrap,
body.light-theme .news-container,
body.light-theme .news-host,
body.light-theme .news-shell,
body.light-theme .news-box,
body.light-theme .news-area,
body.light-theme .right-news,
body.light-theme .sidebar-news{
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

/* 2) Scroll alanı + liste arka planı */
body.light-theme .news-scroll,
body.light-theme .news-list,
body.light-theme .news-items{
  background: #ffffff !important;
}

/* 3) Eğer mavi görünen yer “haber kartlarının altındaki boşluk” ise */
body.light-theme .news-panel,
body.light-theme #news-panel{
  padding-bottom: 12px;           /* altta boşluk varsa beyaz kalsın */
  border-radius: 18px;
  overflow: hidden;               /* alttan/gradyandan sızıntı olmasın */
}

/* 4) En son çare: haber alanındaki “genel koyu zemin” class’ı */
body.light-theme .news-bg,
body.light-theme .news-dark,
body.light-theme .panel-dark{
  background: #ffffff !important;
}
/* ===== LIGHT THEME: haber portalı sızıntı kapatma (F12 yoksa balyoz) ===== */
body.light-theme [id*="news"],
body.light-theme [class*="news"],
body.light-theme [class*="News"]{
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

/* Scroll alanı ve listenin alt boşluğu */
body.light-theme [class*="news"] *{
  background-color: transparent;
}
body.light-theme [class*="news"]{
  overflow: hidden;
  border-radius: 18px;
}
