/* ============================================
   GizleNL - Main Stylesheet
   Variables, Reset, Layout, Typography, Dark Mode
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --color-primary: #0A1628;
  --color-primary-light: #142240;
  --color-accent: #C9A84C;
  --color-accent-hover: #D4B85E;
  --color-accent-dark: #A88B3A;
  --color-white: #FFFFFF;
  --color-off-white: #F5F5F7;
  --color-light-gray: #E8E8ED;
  --color-medium-gray: #B0B0B8;
  --color-dark-gray: #6B6B76;
  --color-text: #1A1A2E;
  --color-text-secondary: #4A4A5A;
  --color-text-muted: #8A8A9A;
  --color-border: #E0E0E6;
  --color-success: #2ECC71;
  --color-error: #E74C3C;
  --color-warning: #F39C12;
  --color-info: #3498DB;
  --color-live: #E74C3C;
  --color-premium: #C9A84C;
  --color-breaking: #E74C3C;

  /* Backgrounds */
  --bg-body: #F5F5F7;
  --bg-surface: #FFFFFF;
  --bg-surface-alt: #F0F0F5;
  --bg-header: rgba(255, 255, 255, 0.95);
  --bg-footer: #0A1628;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FAFAFA;
  --bg-overlay: rgba(10, 22, 40, 0.7);
  --bg-ticker: #0A1628;

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;

  /* Font Sizes */
  --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;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

  /* Font Weights */
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;
  --fw-black: 900;

  /* Line Heights */
  --lh-tight: 1.2;
  --lh-snug: 1.35;
  --lh-normal: 1.6;
  --lh-relaxed: 1.75;

  /* Spacing (8px base grid) */
  --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;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(10, 22, 40, 0.05);
  --shadow-md: 0 4px 6px rgba(10, 22, 40, 0.07), 0 1px 3px rgba(10, 22, 40, 0.05);
  --shadow-lg: 0 10px 25px rgba(10, 22, 40, 0.08), 0 4px 10px rgba(10, 22, 40, 0.05);
  --shadow-xl: 0 20px 40px rgba(10, 22, 40, 0.1), 0 8px 16px rgba(10, 22, 40, 0.06);
  --shadow-card: 0 2px 8px rgba(10, 22, 40, 0.06);
  --shadow-card-hover: 0 8px 24px rgba(10, 22, 40, 0.12);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index layers */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-drawer: 400;
  --z-modal-backdrop: 500;
  --z-modal: 600;
  --z-tooltip: 700;
  --z-toast: 800;

  /* Layout */
  --container-max: 1200px;
  --container-wide: 1400px;
  --container-narrow: 800px;
  --header-height: 64px;
  --sidebar-width: 320px;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --color-text: #E8E8ED;
  --color-text-secondary: #B0B0B8;
  --color-text-muted: #8A8A9A;
  --color-border: #2A2A3A;
  --bg-body: #0D0D14;
  --bg-surface: #1A1A2E;
  --bg-surface-alt: #14142A;
  --bg-header: rgba(26, 26, 46, 0.95);
  --bg-card: #1A1A2E;
  --bg-card-hover: #222240;
  --bg-overlay: rgba(0, 0, 0, 0.8);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.35);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--bg-body);
  min-height: 100vh;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  overflow-wrap: break-word;
}

p {
  overflow-wrap: break-word;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* --- Typography --- */
h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

@media (max-width: 768px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
  h4 { font-size: var(--text-lg); }
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.main-content {
  padding-top: calc(var(--header-height) + var(--space-8));
  min-height: 100vh;
}

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.grid--sidebar {
  grid-template-columns: 1fr var(--sidebar-width);
}

.grid--sidebar-left {
  grid-template-columns: var(--sidebar-width) 1fr;
}

@media (max-width: 1024px) {
  .grid--sidebar,
  .grid--sidebar-left {
    grid-template-columns: 1fr;
  }
}

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

@media (min-width: 769px) and (max-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

/* Flexbox Helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* --- Sections --- */
.section {
  padding: var(--space-16) 0;
}

.section--sm {
  padding: var(--space-8) 0;
}

.section--lg {
  padding: var(--space-24) 0;
}

.section--dark {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.section--alt {
  background-color: var(--bg-surface-alt);
}

.section__header {
  margin-bottom: var(--space-8);
}

.section__title {
  font-size: var(--text-3xl);
  font-weight: var(--fw-bold);
  color: var(--color-text);
  position: relative;
  padding-bottom: var(--space-3);
}

.section__title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--color-accent);
}

.section__title--center {
  text-align: center;
}

.section__title--center::after {
  left: 50%;
  transform: translateX(-50%);
}

.section--dark .section__title {
  color: var(--color-white);
}

.section__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  margin-top: var(--space-3);
  max-width: 600px;
}

.section__subtitle--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* --- Utility Classes --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-accent);
  color: var(--color-primary);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-weight: var(--fw-semibold);
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

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

.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-accent { color: var(--color-accent); }
.text-white { color: var(--color-white); }

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

.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); }

.hidden { display: none !important; }

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

.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;
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .fade-in-left,
  .fade-in-right {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* --- Focus Styles (Accessibility) --- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* --- Selection --- */
::selection {
  background-color: var(--color-accent);
  color: var(--color-primary);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-surface-alt);
}

::-webkit-scrollbar-thumb {
  background: var(--color-medium-gray);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-dark-gray);
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--color-primary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #3A3A4A;
}
