/* ServiseHazır Fiyat Takip — ortak tasarım katmanı (Bootstrap 5.3 üzerine) */

:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e7ecf3;
  --line-2: #f1f4f9;
  --surface: #ffffff;
  --bg: #f3f6fb;
  --brand: #2563eb;
  --brand-2: #4f46e5;
  --brand-3: #7c3aed;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 6px rgba(16, 24, 40, .04);
  --shadow-2: 0 10px 30px rgba(16, 24, 40, .08), 0 2px 6px rgba(16, 24, 40, .04);
  --bs-border-radius: .65rem;
  --bs-border-radius-lg: .9rem;
}

/* ---------- Zemin ---------- */
body {
  background:
    radial-gradient(1200px 560px at 105% -8%, rgba(79, 70, 229, .07), transparent 60%),
    radial-gradient(900px 520px at -10% 4%, rgba(37, 99, 235, .06), transparent 60%),
    var(--bg) !important;
  color: var(--ink-2);
  -webkit-font-smoothing: antialiased;
}
.content-area { background: transparent !important; }
h1, h2, h3, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--ink); letter-spacing: -.01em; }

/* ---------- Kartlar ---------- */
.card {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-1) !important;
  background: var(--surface);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card > .card-header:first-child { border-radius: var(--radius) var(--radius) 0 0 !important; }
a.card:hover, .card.hoverable:hover { transform: translateY(-2px); box-shadow: var(--shadow-2) !important; border-color: #dbe4f0 !important; }
.card .table-responsive:last-child, .card > .list-group:last-child { border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Tablolar ---------- */
.table { --bs-table-bg: transparent; color: var(--ink-2); }
.table > :not(caption) > * > * { border-bottom-color: var(--line-2); }
.table thead th, .table-light th, thead.table-light th {
  background: #f8fafc !important;
  color: var(--muted) !important;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--line) !important;
  white-space: nowrap;
}
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f6f9ff; }

/* ---------- Düğmeler ve formlar ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 600; letter-spacing: .005em; }
.btn-sm { border-radius: 8px; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: 0;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .25);
}
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg, #1d4ed8, #4338ca); box-shadow: 0 6px 18px rgba(37, 99, 235, .32); }
.btn-warning { box-shadow: 0 4px 14px rgba(245, 158, 11, .25); }
.btn-light { background: #fff; }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: #dfe6ef; }
.form-control:focus, .form-select:focus { border-color: #93b4f8; box-shadow: 0 0 0 .22rem rgba(37, 99, 235, .12); }
.input-group-text { border-color: #dfe6ef; background: #f8fafc; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.badge { font-weight: 600; letter-spacing: .01em; }
.alert { border-radius: 12px; }
.progress { background: #eef2f7; border-radius: 999px; }
.progress-bar { border-radius: 999px; }
.list-group-item { border-color: var(--line-2); }

/* ---------- Yan menü ---------- */
.sidebar {
  background: linear-gradient(180deg, #0b1220 0%, #111a2e 55%, #16213a 100%) !important;
  border-right: 1px solid rgba(255, 255, 255, .04);
}
.sidebar-brand span { background: linear-gradient(90deg, #fff, #c7d2fe); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sidebar a { position: relative; }
.sidebar a:hover { background: rgba(255, 255, 255, .06) !important; }
.sidebar a.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, .95), rgba(79, 70, 229, .95)) !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .35) !important;
}
.sidebar a.active::before {
  content: ""; position: absolute; left: -12px; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: #93c5fd;
}

/* ---------- Üst çubuk ---------- */
.topbar { background: rgba(255, 255, 255, .78) !important; backdrop-filter: saturate(160%) blur(10px); }
.topbar-title { font-weight: 700; }

/* ---------- Canlı göstergesi ---------- */
.live-pill {
  display: inline-flex; align-items: center; gap: .4rem; height: 30px; padding: 0 .7rem; border-radius: 999px;
  font-size: .75rem; font-weight: 700; color: #166534; background: #ecfdf5; border: 1px solid #bbf7d0;
  user-select: none; transition: all .2s ease;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: live-pulse 1.8s infinite; }
.live-pill[data-state="sync"] { color: #1e40af; background: #eff6ff; border-color: #bfdbfe; }
.live-pill[data-state="sync"] .live-dot { background: #3b82f6; animation: live-spin .8s linear infinite; border-radius: 2px; }
.live-pill[data-state="off"] { color: #64748b; background: #f1f5f9; border-color: #e2e8f0; }
.live-pill[data-state="off"] .live-dot, .live-pill[data-state="idle"] .live-dot { background: #94a3b8; animation: none; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@keyframes live-spin { to { transform: rotate(360deg); } }
@media (max-width: 576px) { .live-pill .live-label { display: none; } .live-pill { padding: 0 .55rem; } }

/* Değişen metin ve yeni satır vurgusu */
.live-changed { animation: live-changed 2s ease-out; border-radius: 6px; }
.live-added { animation: live-added 2.2s ease-out; }
@keyframes live-changed { 0%, 25% { background-color: rgba(250, 204, 21, .45); box-shadow: 0 0 0 3px rgba(250, 204, 21, .25); } 100% { background-color: transparent; box-shadow: none; } }
@keyframes live-added { 0%, 25% { background-color: rgba(34, 197, 94, .18); } 100% { background-color: transparent; } }

/* İlk açılışta içerik yumuşakça belirsin */
.live-boot > * { animation: rise-in .45s cubic-bezier(.2, .7, .2, 1) both; }
.live-boot > *:nth-child(2) { animation-delay: .04s; }
.live-boot > *:nth-child(3) { animation-delay: .08s; }
.live-boot > *:nth-child(4) { animation-delay: .12s; }
.live-boot > *:nth-child(n+5) { animation-delay: .16s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .live-boot > *, .live-changed, .live-added, .live-dot, a.card:hover { animation: none !important; transform: none !important; }
}

/* ---------- Bileşen ayrıntıları ---------- */
.icon-tile { box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .04); }
.stat-value, .an-big, .fs-3.fw-bold { font-variant-numeric: tabular-nums; }
td, .stat-sub { font-variant-numeric: tabular-nums; }
.dropdown-menu { border-radius: 12px; }
.nav-pills .nav-link { border-radius: 10px; font-weight: 600; color: var(--ink-2); }
.nav-pills .nav-link.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 4px 14px rgba(37, 99, 235, .25); }
.site-footer { border-top-color: var(--line) !important; }

/* ---------- Kaydırma çubukları ---------- */
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: #94a3b8; }
