/* ========================================
   OLLEB BOBIN DESIGN SYSTEM
   Tüm projeleriniz için tutarlı stilizasyon

   Kullanım: Bu dosyayı projenize dahil edin
   <link rel="stylesheet" href="olleb-design.css">

   Fontları şu adresten yükleyin:
   https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@600;700&family=IBM+Plex+Mono:wght@400;600&display=swap
   ======================================== */

/* ========== RENKLERİ ÖZELLEŞTIR ========== */
:root {
  /* ANA RENKLER */
  --bg: #F4F7FA;
  --surface: #FFFFFF;
  --surface-alt: #EAF1F6;
  --ink: #16202B;
  --ink-soft: #5C6B7A;

  /* PRIMARY COLORS */
  --primary: #1B3A5C;
  --primary-dark: #0F2438;
  --accent: #7FB8DE;
  --accent-soft: #DCEEF8;

  /* DURUM RENKLERİ */
  --success: #3A7D44;
  --success-soft: #DEEBDD;
  --danger: #B23A34;
  --danger-soft: #F4DEDC;
  --warning: #D9782C;
  --warning-soft: #FBE7D3;

  /* KISITLAMALAR */
  --border: #D7E2EA;
  --radius: 10px;

  /* FONTLAR */
  --font-main: 'Inter', system-ui, sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

/* ========== BASE STYLES ========== */

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: 32px;
  line-height: 1.2;
}

h2 {
  font-size: 24px;
  line-height: 1.3;
}

h3 {
  font-size: 18px;
  line-height: 1.4;
}

h4 {
  font-size: 16px;
  line-height: 1.4;
}

p {
  margin: 0 0 12px 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ========== BUTTONS ========== */

button, .btn, .btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning {
  /* Şablonlar varyant sınıfını doğrudan kullanır (`<a class="btn-secondary">`), `.btn` gerekmez. */
  all: unset;
  box-sizing: border-box; /* `all: unset` global box-sizing'i siliyor; width:100% buton taşmasın. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  border: none;
}

/* Primary Button */
.btn-primary, button.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover, button.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 58, 92, 0.2);
}

.btn-primary:active, button.btn-primary:active {
  transform: translateY(0);
}

/* Secondary Button */
.btn-secondary, button.btn-secondary {
  background: var(--surface-alt);
  color: var(--primary);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover, button.btn-secondary:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* Success Button */
.btn-success, button.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover, button.btn-success:hover {
  opacity: 0.9;
}

/* Danger Button */
.btn-danger, button.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover, button.btn-danger:hover {
  opacity: 0.9;
}

/* Warning Button */
.btn-warning, button.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-warning:hover, button.btn-warning:hover {
  opacity: 0.9;
}

/* Disabled State */
button:disabled, .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ========== FORMS ========== */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
select,
textarea {
  font-family: var(--font-main);
  font-size: 14px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: var(--surface-alt);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, background-color 0.15s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background-color: #fff;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="number"]::placeholder,
input[type="date"]::placeholder,
input[type="search"]::placeholder,
textarea::placeholder {
  color: var(--ink-soft);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C6B7A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 20px;
  padding-right: 32px;
}

.form-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 4px;
}

.form-success {
  color: var(--success);
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
}

/* ========== BADGES ========== */

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.badge-primary {
  background: var(--accent-soft);
  color: var(--primary);
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-soft);
}

/* ========== ALERTS ========== */

.alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  border-left: 4px solid;
  line-height: 1.6;
}

.alert-info {
  background: var(--accent-soft);
  color: var(--primary-dark);
  border-color: var(--accent);
}

.alert-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: var(--success);
}

.alert-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}

.alert-warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: var(--warning);
}

/* ========== CARDS & PANELS ========== */

.card,
.panel,
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.card + .card,
.panel + .panel,
.section + .section {
  margin-top: 20px;
}

.card-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.card-body {
  padding: 0;
}

.card-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

/* ========== TABLES ========== */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}

thead {
  background: var(--surface-alt);
}

thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 12px;
  border-bottom: 1.5px solid var(--border);
}

thead th.sortable {
  cursor: pointer;
  user-select: none;
}

thead th.sortable:hover {
  color: var(--primary);
}

tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:hover {
  background: var(--surface-alt);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ========== TYPOGRAPHY ========== */

.mono {
  font-family: var(--font-mono);
}

.mono.bold {
  font-weight: 600;
}

.text-primary {
  color: var(--primary);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--warning);
}

.text-soft {
  color: var(--ink-soft);
}

.text-small {
  font-size: 12px;
}

.text-xs {
  font-size: 11px;
}

.text-uppercase {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.font-heading {
  font-family: var(--font-heading);
}

.font-mono {
  font-family: var(--font-mono);
}

/* ========== LAYOUT ========== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-sm {
  gap: 8px;
}

.gap-md {
  gap: 16px;
}

.gap-lg {
  gap: 24px;
}

.mt-sm {
  margin-top: 8px;
}

.mt-md {
  margin-top: 16px;
}

.mt-lg {
  margin-top: 24px;
}

.mb-sm {
  margin-bottom: 8px;
}

.mb-md {
  margin-bottom: 16px;
}

.mb-lg {
  margin-bottom: 24px;
}

.p-sm {
  padding: 8px;
}

.p-md {
  padding: 16px;
}

.p-lg {
  padding: 24px;
}

/* ========== STAT CARDS ========== */

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ========== EMPTY STATES ========== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 28px;
}

.empty-state h3 {
  color: var(--ink);
  font-size: 16px;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
  max-width: 340px;
  line-height: 1.6;
}

/* ========== UTILITIES ========== */

.rounded {
  border-radius: var(--radius);
}

.rounded-sm {
  border-radius: 7px;
}

.rounded-lg {
  border-radius: 14px;
}

.shadow-sm {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.shadow-md {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.shadow-lg {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.border {
  border: 1px solid var(--border);
}

.border-top {
  border-top: 1px solid var(--border);
}

.border-bottom {
  border-bottom: 1px solid var(--border);
}

.opacity-50 {
  opacity: 0.5;
}

.opacity-75 {
  opacity: 0.75;
}

.cursor-pointer {
  cursor: pointer;
}

.cursor-default {
  cursor: default;
}

.user-select-none {
  user-select: none;
}

.transition {
  transition: all 0.15s ease;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  button, .btn {
    font-size: 13px;
    padding: 10px 18px;
  }

  .card,
  .panel,
  .section {
    padding: 16px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 12px;
  }

  thead th,
  tbody td {
    padding: 8px;
  }
}

/* ========== ACCESSIBILITY ========== */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1419;
    --surface: #1A2332;
    --surface-alt: #222E3E;
    --ink: #E7F0F6;
    --ink-soft: #A8B9C9;
    --border: #2D3E50;

    /* Açık moddaki koyu lacivert --primary koyu zeminde okunmuyor. */
    --primary: #6FA8D8;
    --primary-dark: #4E86B8;
    --accent: #7FB8DE;
    --accent-soft: #1B3247;

    --success: #6FBF73;
    --success-soft: #1E3320;

    --danger: #E2837D;
    --danger-soft: #3A211F;

    --warning: #E8A165;
    --warning-soft: #3C2A17;
  }
}
