/* ==========================================================================
   NACİ USTA - TEMA VE DEĞİŞKEN SİSTEMİ (themes.css)
   Varsayılan: Mat Siyah (Matte Black)
   Alternatifler: Gold (Ekru), Beyaz, Mürdüm ve Ramazan
   ========================================================================== */

/* 1. KÖK DEĞİŞKENLER VE VARSAYILAN MAT SİYAH (ZİFİRİ SİMSİYAH) TEMA */
:root,
[data-theme="matte-black"],
[data-theme="mat-siyah"],
[data-theme="gece"] {
  /* Renk Paleti - Zifiri Simsiyah (#000000) */
  --bg-primary: #000000;          /* Zifiri simsiyah ana zemin */
  --bg-surface: #040404;          /* Kart ve modal zeminleri (zifiri siyah) */
  --bg-surface-glass: rgba(0, 0, 0, 0.96); /* Yarı saydam yüzey */
  --bg-surface-alt: #070707;      /* İkincil yüzey / çip arka planı */
  --bg-surface-dark: #000000;     /* En koyu kontrast elemanları */
  
  --text-primary: #F5F2EB;        /* Sıcak ekru/beyaz ana metin (WCAG AAA > 19:1) */
  --text-secondary: #B5AFA4;      /* İkincil metin */
  --text-muted: #7D786F;          /* Pasif / açıklama metni */
  --text-inverse: #000000;        /* Buton içi koyu metin */

  --color-gold: #C9A24B;          /* Tek vurgu: Mat lüks altın */
  --color-gold-hover: #E3C77A;    /* Hover altını */
  --color-gold-dark: #C9A24B;     /* Zifiri siyah üzerinde parlak ve net altın */
  --color-gold-light: rgba(201, 162, 75, 0.14); /* Altın zemin tonu */
  --color-gold-glow: rgba(201, 162, 75, 0.18); /* Hafif sıcak parlama */
  
  --color-murdum: #381232;        /* Gaziantep mürdüm tonu */
  --color-murdum-hover: #4a1942;
  --color-danger: #ef4444;        /* Uyarı kırmızısı */
  --color-success: #22c55e;       /* Başarı yeşili */

  /* İnce 1px kenarlık sistemi */
  --border-light: rgba(255, 255, 255, 0.09);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-gold: #C9A24B;
  
  --header-bg: rgba(0, 0, 0, 0.98);
  --footer-bg: #000000;
  --footer-text: #F5F2EB;

  --logo-filter: none;
}

/* 2. GOLD (EKRU) TEMA */
[data-theme="gold"] {
  --bg-primary: #f7f3e9;          /* Sıcak ekru zemin */
  --bg-surface: #ffffff;          /* Kart ve modal zeminleri */
  --bg-surface-glass: rgba(255, 255, 255, 0.88);
  --bg-surface-alt: #eee7d5;      /* İkincil yüzey / çip arka planı */
  --bg-surface-dark: #1f1a14;
  
  --text-primary: #262017;        /* Derin sıcak antrasit/kahve */
  --text-secondary: #574b3d;
  --text-muted: #857563;
  --text-inverse: #f7f3e9;

  --color-gold: #c9a24b;
  --color-gold-hover: #b38b36;
  --color-gold-dark: #8a6414;
  --color-gold-light: #f3e9cf;
  --color-gold-glow: rgba(201, 162, 75, 0.25);
  
  --color-murdum: #4a1942;
  --color-murdum-hover: #381232;
  --color-danger: #b91c1c;
  --color-success: #15803d;

  --border-light: rgba(138, 100, 20, 0.15);
  --border-medium: rgba(138, 100, 20, 0.35);
  --border-gold: #c9a24b;
  
  --header-bg: rgba(247, 243, 233, 0.94);
  --footer-bg: #1f1814;
  --footer-text: #eee7d5;

  --logo-filter: none;
}

/* 3. BEYAZ TEMA */
[data-theme="white"] {
  --bg-primary: #ffffff;
  --bg-surface: #f9fafb;
  --bg-surface-glass: rgba(249, 250, 251, 0.92);
  --bg-surface-alt: #f3f4f6;
  --bg-surface-dark: #111827;

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-inverse: #ffffff;

  --color-gold: #4a1942;
  --color-gold-hover: #391233;
  --color-gold-dark: #320f2c;
  --color-gold-light: #f6eaf3;
  --color-gold-glow: rgba(74, 25, 66, 0.15);

  --color-murdum: #4a1942;
  --color-murdum-hover: #381232;
  --color-danger: #dc2626;
  --color-success: #16a34a;

  --border-light: #e5e7eb;
  --border-medium: #d1d5db;
  --border-gold: #4a1942;

  --header-bg: rgba(255, 255, 255, 0.96);
  --footer-bg: #111827;
  --footer-text: #f9fafb;

  --logo-filter: none;
}

[data-theme="white"] .footer {
  --color-gold: #F5D78E;
  --color-gold-hover: #FFE5A8;
  --border-gold: rgba(245, 215, 142, 0.4);
}

/* 4. MÜRDÜM TEMA */
[data-theme="murdum"] {
  --bg-primary: #2a0b27;
  --bg-surface: #381234;
  --bg-surface-glass: rgba(56, 18, 52, 0.9);
  --bg-surface-alt: #471942;
  --bg-surface-dark: #190517;

  --text-primary: #f7f3e9;
  --text-secondary: #d9cdba;
  --text-muted: #b0a18c;
  --text-inverse: #2a0b27;

  --color-gold: #e5c158;
  --color-gold-hover: #f3d47a;
  --color-gold-dark: #d4af37;
  --color-gold-light: rgba(229, 193, 88, 0.15);
  --color-gold-glow: rgba(229, 193, 88, 0.25);

  --color-murdum: #5c1e52;
  --color-murdum-hover: #6e2462;
  --color-danger: #ef4444;
  --color-success: #22c55e;

  --border-light: rgba(229, 193, 88, 0.2);
  --border-medium: rgba(229, 193, 88, 0.4);
  --border-gold: #e5c158;

  --header-bg: rgba(42, 11, 39, 0.95);
  --footer-bg: #190517;
  --footer-text: #f7f3e9;

  --logo-filter: brightness(1.05);
}

/* 5. RAMAZAN TEMASI (MEVSİMSEL GECE TEMASI) */
[data-theme="ramazan"] {
  --bg-primary: #120e24;
  --bg-surface: #1d1738;
  --bg-surface-glass: rgba(29, 23, 56, 0.92);
  --bg-surface-alt: #29204e;
  --bg-surface-dark: #0a0715;

  --text-primary: #fbf7ee;
  --text-secondary: #dcd3bd;
  --text-muted: #a69b82;
  --text-inverse: #120e24;

  --color-gold: #f5cf6d;
  --color-gold-hover: #fae093;
  --color-gold-dark: #dfb249;
  --color-gold-light: rgba(245, 207, 109, 0.15);
  --color-gold-glow: rgba(245, 207, 109, 0.35);

  --color-murdum: #3f2054;
  --color-murdum-hover: #50296a;
  --color-danger: #f87171;
  --color-success: #34d399;

  --border-light: rgba(245, 207, 109, 0.22);
  --border-medium: rgba(245, 207, 109, 0.45);
  --border-gold: #f5cf6d;

  --header-bg: rgba(18, 14, 36, 0.96);
  --footer-bg: #0a0715;
  --footer-text: #fbf7ee;

  --logo-filter: drop-shadow(0 0 8px rgba(245, 207, 109, 0.35));
}

/* 6. BAYRAKLI TEMA (MİLLİ BAYRAMLAR & ÖZEL RESMİ GÜNLER TEMASI - GÖZ YORMAYAN YÜKSEK KONTRAST) */
[data-theme="bayrak"] {
  --bg-primary: #100607;
  --bg-surface: #1A0A0D;
  --bg-surface-glass: rgba(26, 10, 13, 0.94);
  --bg-surface-alt: #240E12;
  --bg-surface-dark: #090304;

  --text-primary: #FFFFFF;
  --text-secondary: #F2E8E9;
  --text-muted: #C4AEB0;
  --text-inverse: #100607;

  /* Başlıklar ve fiyatlar yüksek okunabilirlik için sıcak yıldız kremi / altın tonunda */
  --color-gold: #F5D78E;
  --color-gold-hover: #FFE5A8;
  --color-gold-dark: #F7DF9E;
  --color-gold-light: rgba(227, 10, 23, 0.16);
  --color-gold-glow: rgba(227, 10, 23, 0.28);

  --color-murdum: #9E0B14;
  --color-murdum-hover: #BA0D18;
  --color-danger: #ff4d4d;
  --color-success: #22c55e;

  --border-light: rgba(255, 255, 255, 0.12);
  --border-medium: rgba(227, 10, 23, 0.35);
  --border-gold: #E30A17;

  --header-bg: rgba(16, 6, 7, 0.96);
  --footer-bg: #090304;
  --footer-text: #FFFFFF;

  --logo-filter: drop-shadow(0 0 8px rgba(227, 10, 23, 0.35));
}

/* Milli Bayram / Türk Bayrağı Üst Kutlama Bandı (Sürekli Kayan Yazı / Marquee) */
.national-flag-banner {
  display: none;
  background: linear-gradient(90deg, #7A0007 0%, #C80814 50%, #7A0007 100%);
  color: #FFFFFF;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.45rem 0;
  font-size: var(--text-sm);
  font-weight: 600;
  position: relative;
  z-index: calc(var(--z-header) + 12);
  box-shadow: 0 3px 14px rgba(200, 8, 20, 0.35);
  overflow: hidden;
  white-space: nowrap;
}

[data-theme="bayrak"] .national-flag-banner {
  display: block;
}

.national-flag-banner-inner {
  display: inline-flex;
  align-items: center;
  gap: 2.5rem;
  width: max-content;
  animation: topBannerMarquee 22s linear infinite;
  will-change: transform;
}

.national-flag-banner:hover .national-flag-banner-inner {
  animation-play-state: paused;
}

.national-flag-marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

@keyframes topBannerMarquee {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

.waving-flag-icon {
  width: 24px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 2px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  animation: flagWaveAnim 2.6s ease-in-out infinite alternate;
  transform-origin: left center;
}

@keyframes flagWaveAnim {
  0% { transform: perspective(200px) rotateY(-8deg) skewY(-2deg); }
  100% { transform: perspective(200px) rotateY(8deg) skewY(2deg); }
}

/* BAYRAK TEMASI ARKA PLAN ZARİF VE GÖZ YORMAYAN DALGALANAN TÜRK BAYRAĞI FİLİGRANI */
.bayrak-waving-bg {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 0.085;
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9) 15%, rgba(0, 0, 0, 0.2) 85%);
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9) 15%, rgba(0, 0, 0, 0.2) 85%);
}

[data-theme="bayrak"] .bayrak-waving-bg {
  display: block;
}

.bayrak-waving-bg canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* MAT SİYAH İÇİN FİLM GRENİ DOKUSU (body::before) */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* TİPOGRAFİ, BOŞLUK VE EFEKT SİSTEMİ (HER TEMADA ORTAK) */
:root {
  /* Font Aileleri */
  --font-serif: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-arabic: "Cairo", "Tajawal", -apple-system, BlinkMacSystemFont, sans-serif;

  /* Akışkan Font Boyutları (fluid typography with clamp) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.825rem + 0.25vw, 0.9375rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem); /* Mobilde asla 16px altı değil */
  --text-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem);
  --text-3xl: clamp(1.875rem, 1.65rem + 1.1vw, 2.375rem);
  --text-4xl: clamp(2.25rem, 1.95rem + 1.5vw, 3.25rem);
  --text-hero: clamp(2.35rem, 2rem + 1.8vw, 4.25rem);

  /* 4/8px Boşluk Sistemi */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  --space-24: 6rem;    /* 96px */

  /* Yuvarlatılmış Köşeler */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Gölgeler */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.25);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.35);
  --shadow-gold: 0 6px 20px var(--color-gold-glow);

  /* Animasyon ve Geçiş */
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.45s cubic-bezier(0.16, 1, 0.3, 1);

  /* Z-index Katmanları */
  --z-base: 1;
  --z-sticky: 100;
  --z-header: 500;
  --z-drawer: 800;
  --z-modal: 900;
  --z-toast: 1000;
  --z-splash: 1200;

  /* Mobil Çentik Güvenli Alanlar */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* Arapça İçin Font Değişimi */
[dir="rtl"] {
  font-family: var(--font-arabic);
}
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] .font-serif {
  font-family: var(--font-arabic);
  font-weight: 700;
}

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