/* base.css — project-wide tokens, reset, font, form/btn defaults,
   status messages, confirm-dialog, tab strip. Loaded by every layout
   Component. */

@font-face {
  font-family: 'PublicSans';
  src: url('../fonts/PublicSans-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PublicSans';
  src: url('../fonts/PublicSans-Italic-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --fg: #222;
  --bg: #fff;
  --border: #d8dce0;
  --border-soft: #ebeef0;
  --muted: #666;
  --muted-soft: #999;
  --bg-soft: #f8f9fa;
  --bg-hover: #edf2f7;

  /* Navy = ana eylem rengi (button, link, başlık, focus). */
  --primary: #033366;
  --primary-dark: #022447;     /* border + active state (primary'den koyu) */
  --primary-darker: #1960ac;
  --primary-soft: #e8f0fa;

  /* Accent = marka turuncusu (vurgu, footer, brand bant). */
  --accent: #FE5200;
  --accent-soft: #fff1e8;

  --danger: #c0392b;
  --warn: #b08600;
  --warn-bg: #fff8e1;
  --warn-border: #f1d77b;

  --success: #2d7c2f;

  --radius: 4px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

html { font-family: 'PublicSans', sans-serif; }

body {
  margin: 0;
  font-size: 14px;
  color: var(--fg);
  background: var(--bg-soft);
}

/* ─── Forms / buttons ───────────────────────────────────────── */

button,
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  font-family: inherit;
  font-size: 13px;
}

button {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--fg);
}
button:disabled { color: var(--muted-soft); cursor: not-allowed; }

button.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary-dark);
}

button.secondary {
  background: var(--bg);
  color: var(--fg);
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="url"],
select,
textarea {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
}
textarea {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  resize: vertical;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}

/* ─── Status messages ───────────────────────────────────────── */

.msg-err { color: var(--danger); }
.msg-ok  { color: var(--success); }

/* ─── Confirm dialog (custom element) ───────────────────────── */

.confirm-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  max-width: 480px;
  min-width: 320px;
  background: var(--bg);
}
.confirm-dialog::backdrop { background: rgba(0,0,0,0.4); }
.confirm-dialog p { margin: 0 0 1rem; font-size: 14px; }
.confirm-dialog-form { display: flex; flex-direction: column; gap: 0.75rem; margin: 0 0 1rem; }
.confirm-dialog-form h2 { margin: 0; font-size: 16px; font-weight: 600; }
.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.confirm-dialog .confirm-dialog-error {
  margin: 0.75rem 0 0;
  color: var(--danger);
  font-size: 13px;
}
.stacked-form { display: flex; flex-direction: column; gap: 0.75rem; }
.stacked-form label { display: flex; flex-direction: column; gap: 0.25rem; }
.stacked-form input,
.stacked-form select,
.stacked-form textarea { width: 100%; box-sizing: border-box; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}
thead th {
  background: var(--bg-soft);
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 3px solid var(--border);
}
tbody tr:hover { background: var(--bg-soft); }
tbody tr:last-child td { border-bottom: none; }

/* ─── Tab strip ─────────────────────────────────────────────── */
/* Markup:
     <nav class="tabs" role="tablist">
       <button class="tab active" data-key="…">Label</button>
       …
     </nav>
     <div class="tabs-body">
       <div class="tab-panel" data-key="…">…</div>
       <div class="tab-panel" data-key="…" hidden>…</div>
     </div>
   JS toggles .active on the button and [hidden] on the panel. */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.tabs .tab {
  padding: 0.55rem 1rem;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  margin-bottom: -1px;
}

.tabs .tab:hover:not(.active) {
  background: var(--bg-soft);
  color: var(--fg);
}

.tabs .tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.tabs .tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.tabs-body > .tab-panel[hidden] {
  display: none;
}

@media (max-width: 768px) {
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .tabs .tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}
