/*
 * assets/css/main.css
 * Global değişkenler, reset ve ortak bileşenler
 * Tema: Siyah + Turuncu
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Değişkenler ─────────────────────────────────────────── */
:root {
  --bg:        #0e0e0e;
  --bg-card:   #161616;
  --bg-hover:  #1e1e1e;
  --border:    #2a2a2a;
  --border-lt: #333333;

  --orange:    #f97316;
  --orange-dk: #ea580c;
  --orange-lt: rgba(249,115,22,0.12);

  --white:  #ffffff;
  --text:   #e5e5e5;
  --muted:  #737373;
  --faint:  #404040;

  --green:  #22c55e;
  --red:    #ef4444;
  --blue:   #3b82f6;
  --purple: #a855f7;

  --radius:    12px;
  --radius-lg: 18px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);

  --transition: 0.18s ease;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-lt); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange); }

/* ── Yardımcı Sınıflar ───────────────────────────────────── */
.hidden   { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flex     { display: flex; }
.flex-col { flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }

/* ── Ortak Form Elemanları ───────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.input {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}

.input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

.input::placeholder { color: var(--faint); }

select.input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select.input option { background: #1a1a1a; color: var(--text); }

textarea.input { resize: vertical; min-height: 80px; }

/* ── Ortak Butonlar ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-orange {
  background: var(--orange);
  color: #fff;
}
.btn-orange:hover { background: var(--orange-dk); transform: translateY(-1px); }
.btn-orange:active { transform: translateY(0); }

.btn-ghost {
  background: var(--bg-card);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--red);
  border: 1.5px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; }

/* ── Kart ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border-lt); }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.2s ease;
}

.modal-wide { max-width: 640px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
}

.modal-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--muted);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text); }

.modal-body { padding: 24px; }
.modal-body .field + .field { margin-top: 16px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Badge / Etiket ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-orange  { background: var(--orange-lt); color: var(--orange); }
.badge-green   { background: rgba(34,197,94,0.1); color: var(--green); }
.badge-red     { background: rgba(239,68,68,0.1); color: var(--red); }
.badge-blue    { background: rgba(59,130,246,0.1); color: var(--blue); }
.badge-purple  { background: rgba(168,85,247,0.1); color: var(--purple); }
.badge-neutral { background: var(--bg-hover); color: var(--muted); }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  z-index: 9999;
  opacity: 0;
  transition: all 0.25s ease;
  white-space: nowrap;
  box-shadow: var(--shadow);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.toast-success { border-color: var(--green); color: var(--green); }
.toast.toast-error   { border-color: var(--red);   color: var(--red); }
.toast.toast-orange  { border-color: var(--orange); color: var(--orange); }

/* ── Boş State ───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  color: var(--muted);
  text-align: center;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
}
.empty-state svg { margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; }

/* ── Anim ────────────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fade-up 0.25s ease both; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ── Grid ────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
}
