/* ═══════════════════════════════════════════════════════════════
   BBL TAKİP Fav Grid — 3 Sütun Kutucuk Tasarımı
   v587
   ═══════════════════════════════════════════════════════════════ */

/* ── Grid Container ───────────────────────────────────────────── */
.fg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  width: 100%;
  box-sizing: border-box;
}

/* ── Kutucuk ──────────────────────────────────────────────────── */
.fg-card {
  position: relative;
  background: #0f172a;
  border: 0.5px solid rgba(71, 85, 105, 0.4);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.fg-card:hover {
  border-color: rgba(250, 204, 21, 0.4);
  background: #131d30;
}

/* PC: hover ile büyüt */
html:not(.mobile-device) .fg-card {
  transition: border-color 0.15s, background 0.15s, transform 0.2s ease, box-shadow 0.2s ease, z-index 0s;
}
html:not(.mobile-device) .fg-card:hover {
  transform: scale(1.12);
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(250, 204, 21, 0.15);
}
.fg-card:active {
  background: rgba(59, 130, 246, 0.12);
}

/* ── Sol Kenar Kondisyon Barı ─────────────────────────────────── */
.fg-cond-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(51, 65, 85, 0.4);
  border-radius: 2px 0 0 2px;
  z-index: 1;
}
.fg-cond-fill {
  width: 100%;
  position: absolute;
  bottom: 0;
  border-radius: 2px 0 0 0;
  transition: height 0.4s ease;
}

/* ── Inner padding ────────────────────────────────────────────── */
.fg-inner {
  padding: 4px 4px 3px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* ── Row 1: Logo + Sembol + Fiyat ─────────────────────────────── */
.fg-row1 {
  display: flex;
  align-items: center;
  gap: 4px;
}
.fg-logo-wrap {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #1e293b;
}
.fg-logo-fb {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  font-weight: 800;
  color: #64748b;
}
.fg-logo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 1;
}
.fg-sym {
  font-size: 11px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  white-space: nowrap;
}
.fg-pos-badge {
  font-size: 7px;
  font-weight: 800;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 3px;
  padding: 0 3px;
  line-height: 1.4;
  flex-shrink: 0;
}
.fg-price {
  margin-left: auto;
  font-size: 10px;
  color: #94a3b8;
  font-family: monospace;
  flex-shrink: 0;
}

/* ── Row 2: Performans Tablosu ────────────────────────────────── */
.fg-perf-grid {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 3px;
  padding: 2px 3px;
}
.fg-perf-hdr {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
}
.fg-perf-hdr span {
  font-size: 7px;
  color: #475569;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.fg-perf-vals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
}
.fg-perf-vals span {
  font-size: 9px;
  font-weight: 700;
  font-family: monospace;
  line-height: 1.3;
}

/* ── Row 3: Endeks Etiketleri ─────────────────────────────────── */
.fg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.fg-idx-tag {
  font-size: 7px;
  font-weight: 700;
  padding: 0 3px;
  border-radius: 2px;
  border: 0.5px solid;
  line-height: 1.5;
  white-space: nowrap;
}

/* ── Row 4: Yetenek Kartları ──────────────────────────────────── */
.fg-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.fg-badge {
  font-size: 7px;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 3px;
  border: 0.5px solid;
  line-height: 1.3;
  white-space: nowrap;
}
/* Badge renkleri */
.fgb-sut   { color: #fca5a5; background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.25); }
.fgb-def, .fgb-reb { color: #86efac; background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.25); }
.fgb-hiz   { color: #93c5fd; background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.25); }
.fgb-guc   { color: #d8b4fe; background: rgba(139, 92, 246, 0.12); border-color: rgba(139, 92, 246, 0.25); }
.fgb-tek, .fgb-ast { color: #fcd34d; background: rgba(234, 179, 8, 0.12); border-color: rgba(234, 179, 8, 0.25); }
.fgb-pot   { color: #fbbf24; background: rgba(250, 204, 21, 0.15); border-color: rgba(250, 204, 21, 0.3); }
.fgb-zek   { color: #93c5fd; background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.2); }

/* ── Row 5: Transfer + FK/PD ──────────────────────────────────── */
.fg-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: 1px;
}
.fg-cost {
  font-size: 9px;
  font-weight: 800;
  color: #fbbf24;
}
.fg-fundamentals {
  font-size: 11px;
  color: #cbd5e1;
  font-family: monospace;
  font-weight: 800;
}

/* ═══════════════════════════════════════════════════════════════
   Detay Panel (Birleşik Hover)
   ═══════════════════════════════════════════════════════════════ */
#fg-detail-panel {
  background: rgba(10, 14, 39, 0.98);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 20px rgba(250, 204, 21, 0.1);
  backdrop-filter: blur(12px);
  animation: fgdFadeIn 0.15s ease-out;
  font-family: 'Inter', 'DM Sans', sans-serif;
}
@keyframes fgdFadeIn {
  from { opacity: 0; transform: translateY(4px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fgd-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}
.fgd-logo {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: #1e293b;
  flex-shrink: 0;
  border: 1px solid rgba(71, 85, 105, 0.5);
}
.fgd-logo-fb {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
}
.fgd-title-area { flex: 1; min-width: 0; }
.fgd-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  flex-shrink: 0;
}
.fgd-close:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

.fgd-body {
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fgd-cond-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fgd-cond-track {
  flex: 1;
  height: 5px;
  background: rgba(51, 65, 85, 0.4);
  border-radius: 3px;
  overflow: hidden;
}
.fgd-cond-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.fgd-perf-table {
  width: 100%;
  border-collapse: collapse;
  font-family: monospace;
  table-layout: fixed;
}
.fgd-perf-table th {
  padding: 2px 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
  white-space: nowrap;
  overflow: hidden;
}
.fgd-perf-table td {
  padding: 3px 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.15);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fgd-perf-table th:first-child,
.fgd-perf-table td:first-child { width: 52px; }
.fgd-perf-table th:nth-child(2),
.fgd-perf-table td:nth-child(2) { width: auto; }
.fgd-perf-table th:nth-child(3),
.fgd-perf-table td:nth-child(3) { width: 60px; }
.fgd-perf-table tr:last-child td { border-bottom: none; }
.fgd-perf-table .t-up { color: #4ade80; }
.fgd-perf-table .t-down { color: #f87171; }
.fgd-perf-table .t-neutral { color: #94a3b8; }

.fgd-fund-row {
  display: flex;
  justify-content: space-around;
  gap: 6px;
  padding: 5px 0;
  border-top: 1px solid rgba(51, 65, 85, 0.3);
  font-size: 10px;
  color: #e2e8f0;
  font-family: monospace;
}
.fgd-fund-row div {
  text-align: center;
}
.fgd-fund-row strong {
  font-weight: 800;
}

.fgd-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 0;
  border-top: 1px solid rgba(51, 65, 85, 0.3);
}

.fgd-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.fgd-btn {
  flex: 1;
  min-width: 60px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  white-space: nowrap;
}
.fgd-transfer {
  background: rgba(250, 204, 21, 0.12);
  color: #fbbf24;
  border-color: rgba(250, 204, 21, 0.3);
}
.fgd-transfer:hover {
  background: rgba(250, 204, 21, 0.25);
}
.fgd-loan {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.3);
}
.fgd-loan:hover {
  background: rgba(139, 92, 246, 0.25);
}
.fgd-swap {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}
.fgd-swap:hover {
  background: rgba(59, 130, 246, 0.25);
}
.fgd-watch {
  background: rgba(168, 85, 247, 0.1);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.25);
}
.fgd-watch:hover {
  background: rgba(168, 85, 247, 0.2);
}
.fgd-danger {
  background: rgba(244, 63, 94, 0.1);
  color: #f87171;
  border-color: rgba(244, 63, 94, 0.25);
}
.fgd-danger:hover {
  background: rgba(244, 63, 94, 0.2);
}

/* ── Mobil düzeltmeleri ────────────────────────────────────────── */
html.mobile-device .fg-grid {
  gap: 4px;
  padding: 4px;
}
html.mobile-device .fg-inner {
  padding: 4px 4px 3px 7px;
  gap: 2px;
}
html.mobile-device .fg-sym {
  font-size: 10px;
}
html.mobile-device .fg-price {
  font-size: 9px;
}
html.mobile-device .fg-perf-vals span {
  font-size: 8px;
}
html.mobile-device .fg-idx-tag {
  font-size: 6px;
}
html.mobile-device .fg-badge {
  font-size: 6px;
}
html.mobile-device .fg-cost {
  font-size: 8px;
}
html.mobile-device .fg-fundamentals {
  font-size: 11px;
  color: #cbd5e1;
}
html.mobile-device .fg-logo-wrap {
  width: 16px;
  height: 16px;
}

/* ── Flip Kartı ────────────────────────────────────────────────── */
.fg-card-flip {
  min-height: 130px;
  position: relative;
}
.fg-face-front,
.fg-face-back {
  width: 100%;
}
.fg-face-back .fg-inner {
  background: rgba(8, 14, 30, 0.97);
}

/* PC hover scale kaldır — flip kendisi yapıyor */
html:not(.mobile-device) .fg-card-flip:hover {
  transform: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4), 0 0 8px rgba(250,204,21,0.1);
  border-color: rgba(250,204,21,0.35);
}

/* fg-face-back artık normal flow'da — kart yüksekliğini korur */
.fg-face-back {
  width: 100%;
  border-radius: 6px;
  background: rgba(6,12,40,0.97);
  box-sizing: border-box;
}
