/* ============================================================
   SEO Panel — Premium Design System
   ============================================================ */

/* ── Google Font ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Design Tokens ───────────────────────────────────────── */
:root {
  /* Sidebar */
  --sb-bg: #070c18;
  --sb-border: rgba(255,255,255,0.055);
  --sb-link: rgba(255,255,255,0.72);
  --sb-link-hover-bg: rgba(255,255,255,0.07);
  --sb-link-active-bg: rgba(99,102,241,0.18);
  --sb-link-active-border: rgba(99,102,241,0.55);
  --sb-link-active-color: #c7d2fe;
  --sb-section-label: rgba(255,255,255,0.32);

  /* Accent */
  --accent: #6366f1;
  --accent-2: #818cf8;
  --accent-glow: rgba(99,102,241,0.25);
  --accent-btn: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);

  /* Content */
  --bg-canvas: #f0f2f8;
  --bg-card: #ffffff;
  --border-card: rgba(0,0,0,0.075);
  --ink: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e8eaf0;

  /* Radius */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;

  /* Shadows */
  --shadow-card: 0 2px 12px rgba(15,23,42,0.07), 0 0 1px rgba(15,23,42,0.06);
  --shadow-card-hover: 0 8px 28px rgba(15,23,42,0.12), 0 0 1px rgba(15,23,42,0.08);
  --shadow-lg: 0 16px 48px rgba(15,23,42,0.14);
  --shadow-sidebar: 4px 0 32px rgba(0,0,0,0.28);
}

/* ── Base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.admin-body {
  background: var(--bg-canvas);
  color: var(--ink);
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.35); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,0.55); }

/* ── Layout ──────────────────────────────────────────────── */
.layout-wrapper { display: flex; min-height: 100vh; }

.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.content-area {
  flex: 1;
  padding: 1.5rem 1.75rem;
}

@media (max-width: 991.98px) {
  .content-area { padding: 1rem; }
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  position: sticky;
  top: 0;
  align-self: flex-start;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 1030;
  box-shadow: var(--shadow-sidebar);
}

/* Noise texture overlay */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: inherit;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid var(--sb-border);
  margin-bottom: 0.5rem;
}

.sidebar-logo { max-height: 34px; border-radius: 8px; }

.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(99,102,241,0.45);
  flex-shrink: 0;
}

.sidebar-brand-text .eyebrow {
  font-size: 0.6rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  line-height: 1;
}
.sidebar-brand-text .name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

.sidebar-nav {
  padding: 0 0.625rem 1rem;
  flex: 1;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 0.6rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sb-section-label);
  padding: 1rem 0.5rem 0.35rem;
  display: block;
  user-select: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: var(--sb-link);
  text-decoration: none;
  margin-bottom: 2px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.18s, color 0.18s;
  position: relative;
  border: 1px solid transparent;
}

.sidebar-link i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.sidebar-link:hover {
  background: var(--sb-link-hover-bg);
  color: #fff;
}

.sidebar-link:hover i { transform: translateX(1px); }

.sidebar-link.active {
  background: var(--sb-link-active-bg);
  color: var(--sb-link-active-color);
  border-color: var(--sb-link-active-border);
  font-weight: 600;
}

.sidebar-link.active i {
  filter: drop-shadow(0 0 6px rgba(129,140,248,0.6));
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent-2);
  border-radius: 0 3px 3px 0;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line) !important;
  padding: 0 1.5rem;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-greeting { font-size: 0.85rem; color: var(--muted); }
.topbar-name { font-weight: 600; color: var(--ink); }

.topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: grid;
  place-items: center;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.topbar-icon-btn:hover {
  background: #e8edf5;
  border-color: #c8d0e0;
  color: var(--ink);
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  border-color: var(--border-card);
  border-radius: var(--r-md);
}

.card.soft {
  border: 1px solid var(--border-card);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  background: var(--bg-card);
  transition: box-shadow 0.2s;
}

.card.soft:hover {
  box-shadow: var(--shadow-card-hover);
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--r-md);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
  position: relative;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stat-color, var(--accent));
  opacity: 0;
  transition: opacity 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.stat-card:hover::after { opacity: 1; }

.stat-card .stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.15rem;
  flex-shrink: 0;
  position: relative;
}

.stat-card .stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-card .stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -.02em;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  font-weight: 600;
  font-size: 0.83rem;
  border-radius: var(--r-sm);
  transition: all 0.18s;
  letter-spacing: .01em;
}

.btn-primary {
  background: var(--accent-btn);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 10px rgba(99,102,241,0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,0.45);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 6px rgba(99,102,241,0.3);
}

.btn-outline-primary {
  border-color: rgba(99,102,241,0.45);
  color: #4f46e5;
}

.btn-outline-primary:hover {
  background: rgba(99,102,241,0.08);
  border-color: #6366f1;
  color: #4f46e5;
}

.btn-outline-secondary {
  border-color: var(--line);
  color: var(--muted);
}

.btn-outline-secondary:hover {
  background: #f8fafc;
  border-color: #c8d0e0;
  color: var(--ink);
}

.btn-light {
  background: #f8fafc;
  border-color: var(--line);
  color: var(--ink);
}

.btn-light:hover {
  background: #f0f3fa;
  border-color: #c8d0e0;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: var(--r-sm);
  border-color: #dde3f0;
  font-size: 0.875rem;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  background: #fff;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
  margin-bottom: 5px;
}

textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Tables ──────────────────────────────────────────────── */
.table {
  font-size: 0.875rem;
  color: var(--ink);
}

.table thead th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  background: #f8fafd;
  border-bottom: 1px solid var(--line) !important;
  padding: 10px 12px;
}

.table td {
  vertical-align: middle;
  padding: 10px 12px;
  border-bottom-color: var(--line);
}

.table tbody tr {
  transition: background 0.14s;
}

.table tbody tr:hover { background: #f8fafd; }

.table-responsive { border-radius: var(--r-sm); overflow: hidden; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: .03em;
  padding: 4px 9px;
  border-radius: 99px;
}

.text-bg-success { background: #dcfce7 !important; color: #15803d !important; border: 1px solid #bbf7d0; }
.text-bg-danger  { background: #fee2e2 !important; color: #dc2626 !important; border: 1px solid #fecaca; }
.text-bg-warning { background: #fef9c3 !important; color: #a16207 !important; border: 1px solid #fef08a; }
.text-bg-light   { background: #f1f5f9 !important; color: var(--muted) !important; border: 1px solid #e2e8f0; }
.text-bg-secondary { background: #f1f5f9 !important; color: var(--muted) !important; }

/* ── Nav Tabs ────────────────────────────────────────────── */
.nav-tabs {
  border-bottom: 2px solid var(--line);
  gap: 2px;
}

.nav-tabs .nav-link {
  border: none;
  border-radius: 0;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 500;
  padding: 8px 14px;
  margin-bottom: -2px;
  border-bottom: 2px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}

.nav-tabs .nav-link:hover {
  color: var(--ink);
  border-bottom-color: #c7d2fe;
  background: transparent;
}

.nav-tabs .nav-link.active {
  color: var(--accent);
  font-weight: 700;
  border-bottom: 2px solid var(--accent);
  background: transparent;
}

/* ── Alert / Flash ───────────────────────────────────────── */
.alert {
  border-radius: var(--r-md);
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 12px 16px;
}

.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  border: 1.5px dashed #dde3f0;
  border-radius: var(--r-md);
  background: #fafbfd;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted-2);
  font-size: 0.875rem;
}

/* ── List Group ──────────────────────────────────────────── */
.list-group-item {
  font-size: 0.875rem;
  border-color: var(--line);
  transition: background 0.14s;
}

.list-group-item-action:hover { background: #f8fafd; }

/* ── Page Headings ───────────────────────────────────────── */
.page-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.02em;
}

h1.h3 {
  font-weight: 800;
  letter-spacing: -.02em;
}

/* ── Auth Page ───────────────────────────────────────────── */
.auth-body {
  background:
    radial-gradient(ellipse 900px 600px at 20% -10%, rgba(99,102,241,0.18), transparent),
    radial-gradient(ellipse 700px 500px at 85% 110%, rgba(14,165,233,0.14), transparent),
    #070c18;
  min-height: 100vh;
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  max-width: 440px;
  width: 100%;
  background: rgba(255,255,255,0.97);
  border-radius: var(--r-xl);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 8px 24px rgba(99,102,241,0.4);
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  gap: 2px;
}

.page-link {
  border-radius: var(--r-sm) !important;
  border-color: var(--line);
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 500;
  padding: 6px 12px;
  transition: all 0.15s;
}

.page-link:hover { background: #f1f5f9; border-color: #c8d0e0; color: var(--ink); }
.page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Dropdown ────────────────────────────────────────────── */
.dropdown-menu {
  border-radius: var(--r-md);
  border-color: var(--line);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  padding: 6px;
}

.dropdown-item {
  border-radius: var(--r-sm);
  padding: 8px 12px;
  transition: background 0.14s;
  color: var(--ink);
}

.dropdown-item:hover { background: #f1f5f9; }

.dropdown-header {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted-2);
  padding: 6px 12px 4px;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-content {
  border-radius: var(--r-lg);
  border-color: var(--line);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom-color: var(--line);
  padding: 1rem 1.25rem 0.875rem;
}

.modal-footer {
  border-top-color: var(--line);
  padding: 0.875rem 1.25rem 1rem;
}

/* ── Offcanvas (mobile nav) ──────────────────────────────── */
.offcanvas.text-bg-dark {
  background: var(--sb-bg) !important;
}

/* ── Breadcrumb / Nav small ──────────────────────────────── */
nav.small a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
nav.small a:hover { color: var(--ink); }

/* ── Report-body text ────────────────────────────────────── */
.report-body {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
}

/* ── Micro-animations ────────────────────────────────────── */
/* Sadece opacity: transform kullanılmaz — aksi halde fixed modal viewport yerine
   bu blokta konumlanır ve backdrop üstte kalır (tıklanamaz gri ekran). */
@keyframes fadeUp {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.content-area > .container-fluid,
.content-area > div {
  animation: fadeUp 0.22s ease both;
}

/* ── Print ───────────────────────────────────────────────── */
.print-report {
  background: #fff;
  color: #111;
}

@media print {
  .no-print { display: none !important; }
  .print-report { padding: 0 !important; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar { display: none; }
}
