/* =========================================================
   PiSMS - Tema Sistemi (CSS Custom Properties)
   ========================================================= */

:root {
  --color-primary: #7C3AED;
  --color-primary-dark: #6D28D9;
  --color-accent: #F5A623;
  --color-accent-dark: #DC8F0F;
  --color-success: #22C55E;
  --color-danger: #EF4444;
  --color-warning: #F59E0B;

  --bg-page: #F8F7FC;
  --bg-surface: #FFFFFF;
  --bg-surface-muted: #F3F1FA;
  --border-color: #E5E1F5;
  --text-primary: #1A1A2E;
  --text-muted: #6B7280;

  --shadow-sm: 0 1px 2px rgba(26, 26, 46, 0.06);
  --shadow-md: 0 4px 16px rgba(26, 26, 46, 0.08);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg-page: #0D0B16;
  --bg-surface: #171426;
  --bg-surface-muted: #1E1A30;
  --border-color: #2A2440;
  --text-primary: #F5F3FF;
  --text-muted: #9CA3AF;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
  overflow-x: hidden; /* mobilde yatay tasma/kaymayi engelle */
}
img { max-width: 100%; display: block; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.25; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
svg.icon { width: 1em; height: 1em; stroke: currentColor; vertical-align: -0.15em; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 0.15s ease, background-color 0.15s ease;
  text-decoration: none;
  line-height: 1;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; filter: none; }
.btn-accent { background: var(--color-accent); color: #1A1A2E; }
.btn-accent:hover { background: var(--color-accent-dark); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-outline { background: transparent; color: var(--text-primary); border-color: var(--border-color); }
.btn-outline:hover { background: var(--bg-surface-muted); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-surface-muted); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.field { margin-bottom: 18px; }
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=date], input[type=datetime-local], input[type=search],
select, textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
textarea { resize: vertical; min-height: 100px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row label { margin: 0; font-weight: 500; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-title { font-size: 14px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.card-value { font-size: 28px; font-weight: 700; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success { background: rgba(34, 197, 94, 0.12); color: var(--color-success); }
.badge-danger { background: rgba(239, 68, 68, 0.12); color: var(--color-danger); }
.badge-warning { background: rgba(245, 158, 11, 0.14); color: var(--color-warning); }
.badge-muted { background: var(--bg-surface-muted); color: var(--text-muted); }
.badge-primary { background: rgba(124, 58, 237, 0.12); color: var(--color-primary); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.1);
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Alerts / flash ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-success { background: rgba(34, 197, 94, 0.1); color: #15803D; border-color: rgba(34,197,94,0.25); }
.alert-danger { background: rgba(239, 68, 68, 0.1); color: #B91C1C; border-color: rgba(239,68,68,0.25); }
.alert-warning { background: rgba(245, 158, 11, 0.12); color: #92400E; border-color: rgba(245,158,11,0.3); }
[data-theme="dark"] .alert-success { color: #4ADE80; }
[data-theme="dark"] .alert-danger { color: #F87171; }
[data-theme="dark"] .alert-warning { color: #FBBF24; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-surface-muted);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-surface-muted); }
.table-empty { text-align: center; color: var(--text-muted); padding: 40px; }

/* ---------- Public nav / marketing ---------- */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text-primary); }
.brand img { height: 56px; width: auto; max-width: 100%; object-fit: contain; }
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a { color: var(--text-primary); font-weight: 500; font-size: 14px; }
.main-nav a:hover { color: var(--color-primary); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--bg-surface-muted); }

.lang-switcher {
  width: auto;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
}

.hero {
  padding: 72px 0;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; }
.hero .accent-word { color: var(--color-accent); }
.hero-lead { color: var(--text-muted); font-size: 17px; max-width: 46ch; }
.hero-cta { display: flex; gap: 12px; margin: 28px 0; flex-wrap: wrap; }
.check-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.check-list li { display: flex; align-items: center; gap: 10px; color: var(--text-primary); font-size: 14px; }
.check-list svg { color: var(--color-success); flex-shrink: 0; }

.mock-window {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
}
.mock-window-bar { display: flex; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--border-color); }
.mock-dot { width: 11px; height: 11px; border-radius: 50%; }
.mock-dot.red { background: #EF4444; }
.mock-dot.yellow { background: #F5A623; }
.mock-dot.green { background: #22C55E; }
.mock-body { padding: 24px; }
.mock-stat-row { display: flex; gap: 16px; margin-bottom: 20px; }
.mock-stat { flex: 1; }
.mock-stat .value { font-size: 22px; font-weight: 700; }
.mock-stat .label { font-size: 12px; color: var(--text-muted); }
.mock-badge {
  position: absolute;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 600;
}
.mock-badge.top-right { top: -18px; right: -14px; }
.mock-badge.bottom-left { bottom: -18px; left: -14px; }

section.section { padding: 64px 0; }
.section-heading { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-heading h2 { font-size: 30px; }
.section-heading p { color: var(--text-muted); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.feature-card { padding: 24px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.feature-card .icon-wrap {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: rgba(124, 58, 237, 0.1); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.feature-card .icon-wrap svg { width: 22px; height: 22px; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.price-card { padding: 28px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); text-align: center; }
.price-card .price { font-size: 34px; font-weight: 800; margin: 12px 0; }
.price-card.featured { border-color: var(--color-accent); box-shadow: var(--shadow-md); }

.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 13px;
}
.footer-pi {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ---------- App shell (admin / customer) ---------- */
.app-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}
.app-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.app-header .brand img { height: 48px; }
.app-nav { display: flex; align-items: center; gap: 4px; }
.app-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}
.app-nav a:hover { background: var(--bg-surface-muted); text-decoration: none; color: var(--text-primary); }
.app-nav a.active { background: rgba(124, 58, 237, 0.1); color: var(--color-primary); }
.app-main { padding: 32px 0 64px; }
.page-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title h1 { font-size: 22px; margin: 0; }

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { justify-content: center; margin-bottom: 24px; }

.filter-bar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { width: auto; min-width: 180px; }

.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab-btn {
  padding: 8px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border-color);
  background: var(--bg-surface); color: var(--text-muted); font-weight: 600; font-size: 13px; cursor: pointer;
}
.tab-btn.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

.spinner-pi {
  display: inline-block;
  font-weight: 700;
  color: var(--color-accent);
  animation: spin-pi 1.1s linear infinite;
}
@keyframes spin-pi { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .pi-mark { font-size: 32px; color: var(--color-accent); font-weight: 700; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; }
}

/* ===== alert-primary (bilgilendirme) ===== */
.alert-primary { background: rgba(124, 58, 237, 0.10); color: var(--color-primary); border-color: rgba(124, 58, 237, 0.28); }
[data-theme="dark"] .alert-primary { color: #C4B5FD; }

/* ===== Kredi paketi kartlari (dikey, profesyonel) ===== */
.package-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.package-card {
  position: relative;
  text-align: center;
  padding: 30px 20px 24px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.package-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}
.package-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--color-primary); }
.package-credits { font-size: 34px; font-weight: 800; color: var(--text-primary); line-height: 1; margin-top: 6px; }
.package-credits-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin-top: 8px; }
.package-divider { width: 44px; height: 3px; border-radius: 3px; background: var(--border-color); margin: 18px auto; }
.package-price { font-size: 30px; font-weight: 800; color: var(--color-accent); margin-bottom: 20px; }
.package-buy { margin-top: auto; }
@media (max-width: 880px) { .package-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .package-grid { grid-template-columns: 1fr; } }

/* ===== Mobil optimizasyon (panel + ana sayfa) ===== */
@media (max-width: 760px) {
  .container { padding-left: 16px; padding-right: 16px; }
  /* Panel ust bar: sar ve nav'i yatay kaydirilabilir yap */
  .app-header .container { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 8px; }
  .app-nav {
    order: 3; width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap; gap: 2px; padding-bottom: 4px;
    scrollbar-width: none;
  }
  .app-nav::-webkit-scrollbar { display: none; }
  .app-nav a { white-space: nowrap; padding: 8px 12px; font-size: 13px; }
  .app-header .brand img { height: 40px; }
  .app-main { padding: 20px 0 48px; }
  .page-title h1 { font-size: 19px; }
  /* Ana sayfa hero */
  .site-header .container { height: auto; padding: 12px 0; flex-wrap: wrap; gap: 10px; }
  .hero { padding: 40px 0; }
  .hero h1 { font-size: 30px; }
  .hero-lead { font-size: 15px; }
  .hero-cta { margin: 20px 0; }
  .hero-cta .btn { flex: 1 1 auto; text-align: center; justify-content: center; }
  .section { padding: 40px 0; }
}
@media (max-width: 420px) {
  .hero h1 { font-size: 25px; }
  .card { padding: 16px; }
}

/* ===== Ana sayfa buyuk logo bandi (klas, ortalanmis) ===== */
.logo-band {
  position: relative;
  text-align: center;
  padding: 76px 20px;
  background:
    radial-gradient(ellipse 55% 120% at 50% 45%, rgba(124, 58, 237, 0.16), transparent 70%),
    linear-gradient(180deg, var(--bg-surface), var(--bg-page));
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}
.logo-band img {
  position: relative;
  height: 132px; width: auto; max-width: 90%;
  object-fit: contain;
  filter: drop-shadow(0 10px 34px rgba(124, 58, 237, 0.35));
}
.logo-band::after {
  content: "";
  display: block;
  width: 130px; height: 3px; margin: 26px auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
}
@media (max-width: 640px) { .logo-band { padding: 44px 16px; } .logo-band img { height: 88px; } }

/* ===== Paket kartlari giris animasyonu (hafif fade-in) ===== */
@keyframes package-fade-in { from { opacity: 0; } to { opacity: 1; } }
.package-card { animation: package-fade-in .45s ease both; }
.package-card:nth-child(2) { animation-delay: .07s; }
.package-card:nth-child(3) { animation-delay: .14s; }
.package-card:nth-child(4) { animation-delay: .21s; }
@media (prefers-reduced-motion: reduce) { .package-card { animation: none; } }
