/* ============================================================
   AI Haber — Design System
   base.css — Temel stiller, CSS custom properties, reset
   ============================================================ */

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

/* --------------------------------------------------------
   CSS Custom Properties — Tema Değişkenleri
   -------------------------------------------------------- */

:root {
  /* Tipografi */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;

  --weight-light:     300;
  --weight-regular:   400;
  --weight-medium:    500;
  --weight-semibold:  600;
  --weight-bold:      700;
  --weight-extrabold: 800;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Border radius */
  --radius-sm:   0.375rem;
  --radius-md:   0.625rem;
  --radius-lg:   1rem;
  --radius-xl:   1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.15), 0 4px 12px rgba(0,0,0,.08);
  --shadow-xl: 0 24px 64px rgba(0,0,0,.20);

  /* Brand (Accent) — Koçan Creative (#ff4a17) */
  --accent-h: 13;
  --accent-s: 100%;
  --accent-l: 54%;
  --accent:          #ff4a17;
  --accent-light:    #ff6b3d;
  --accent-dark:     #e03b0c;
  --accent-subtle:   rgba(255, 74, 23, 0.12);
  --accent-glow:     rgba(255, 74, 23, 0.30);

  /* Layout */
  --container-max: 1280px;
  --sidebar-width: 300px;

  /* Category Accent System */
  --cat-ai:           #a855f7;
  --cat-ai-glow:      rgba(168, 85, 247, 0.25);
  --cat-ai-bg:        rgba(168, 85, 247, 0.12);

  --cat-design:       #ec4899;
  --cat-design-glow:  rgba(236, 72, 153, 0.25);
  --cat-design-bg:    rgba(236, 72, 153, 0.12);

  --cat-seo:          #10b981;
  --cat-seo-glow:     rgba(16, 185, 129, 0.25);
  --cat-seo-bg:       rgba(16, 185, 129, 0.12);

  --cat-marketing:    #f59e0b;
  --cat-marketing-glow: rgba(245, 158, 11, 0.25);
  --cat-marketing-bg: rgba(245, 158, 11, 0.12);
}

/* --------------------------------------------------------
   LIGHT TEMA (varsayılan)
   -------------------------------------------------------- */

[data-theme="light"], :root {
  --bg-primary:    #f8f9fc;
  --bg-secondary:  #ffffff;
  --bg-tertiary:   #f0f2f8;
  --bg-card:       #ffffff;
  --bg-hover:      #f3f4f8;

  --text-primary:   #0d1117;
  --text-secondary: #4b5563;
  --text-tertiary:  #9ca3af;
  --text-on-accent: #ffffff;

  --border-color:   rgba(0,0,0,.08);
  --border-strong:  rgba(0,0,0,.16);
  --divider:        rgba(0,0,0,.06);

  --header-bg:      rgba(255,255,255,.90);
  --header-border:  rgba(0,0,0,.06);

  --badge-bg:       var(--accent-subtle);
  --badge-text:     var(--accent-dark);

  --tag-bg:         #eef0f8;
  --tag-text:       #4b5563;

  --input-bg:       #ffffff;
  --input-border:   rgba(0,0,0,.12);

  --code-bg:        #f0f2f8;

  --scrollbar-track: #f0f2f8;
  --scrollbar-thumb: #c8ccd6;
}

/* --------------------------------------------------------
   DARK TEMA — Koçan Creative Charcoal/Black (#181818 & #ff4a17)
   -------------------------------------------------------- */

[data-theme="dark"] {
  --bg-primary:    #121212;
  --bg-secondary:  #181818;
  --bg-tertiary:   #222222;
  --bg-card:       #181818;
  --bg-hover:      #262626;

  --text-primary:   #fefefe;
  --text-secondary: #a3a3a3;
  --text-tertiary:  #737373;
  --text-on-accent: #ffffff;

  --border-color:   rgba(255,255,255,.09);
  --border-strong:  rgba(255,255,255,.18);
  --divider:        rgba(255,255,255,.07);

  --header-bg:      rgba(18,18,18,.92);
  --header-border:  rgba(255,255,255,.09);

  --badge-bg:       rgba(255, 74, 23, 0.15);
  --badge-text:     #ff6b3d;

  --tag-bg:         #222222;
  --tag-text:       #a3a3a3;

  --input-bg:       #181818;
  --input-border:   rgba(255,255,255,.12);

  --code-bg:        #222222;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.6);
  --shadow-xl: 0 24px 64px rgba(0,0,0,.7);

  --scrollbar-track: #121212;
  --scrollbar-thumb: #333333;
}

/* --------------------------------------------------------
   Reset & Base
   -------------------------------------------------------- */

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-dark);
}

[data-theme="dark"] a:hover {
  color: var(--accent-light);
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-sans);
}

input, textarea, select {
  font-family: var(--font-sans);
}

/* --------------------------------------------------------
   Layout Container
   -------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (max-width: 640px) {
  .container { padding: 0 var(--space-4); }
}

/* --------------------------------------------------------
   Scrollbar
   -------------------------------------------------------- */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* --------------------------------------------------------
   Selection
   -------------------------------------------------------- */

::selection {
  background: var(--accent-glow);
  color: var(--text-primary);
}

/* --------------------------------------------------------
   Focus visible (accessibility)
   -------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------
   Utility — Text
   -------------------------------------------------------- */

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

.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }

.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }

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

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------
   Utility — Flex / Grid
   -------------------------------------------------------- */

.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.justify-center { justify-content: center; }
.justify-between{ justify-content: space-between; }
.gap-2          { gap: var(--space-2); }
.gap-3          { gap: var(--space-3); }
.gap-4          { gap: var(--space-4); }
.gap-6          { gap: var(--space-6); }

.grid { display: grid; }

/* --------------------------------------------------------
   Utility — Spacing
   -------------------------------------------------------- */

.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.py-4  { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-8  { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.py-12 { padding-top: var(--space-12); padding-bottom: var(--space-12); }

/* --------------------------------------------------------
   Utility — Display
   -------------------------------------------------------- */

.hidden  { display: none; }
.block   { display: block; }
.inline  { display: inline; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* --------------------------------------------------------
   Divider
   -------------------------------------------------------- */

.divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: var(--space-6) 0;
}

/* --------------------------------------------------------
   FOUC prevention — body starts invisible, JS reveals it
   -------------------------------------------------------- */

body.loading { visibility: hidden; }
