/* BATbern Platform - Shared Base Styles */

/* CSS Custom Properties - Dark Theme (from web-frontend) */
:root {
  /* OKLCH Dark Theme Colors */
  --background: oklch(0.2223 0.006 271.1393);       /* Dark background */
  --foreground: oklch(0.9551 0 0);                  /* Light text */
  --card: oklch(0.2568 0.0076 274.6528);            /* Card background */
  --card-foreground: oklch(0.9551 0 0);             /* Card text */
  --border: oklch(0.3289 0.0092 268.3843);          /* Border color */
  --primary: oklch(0.685 0.169 237.323);            /* Primary blue */
  --primary-foreground: oklch(1 0 0);               /* Primary text (white) */
  --muted: oklch(0.294 0.013 272.9312);             /* Muted background */
  --muted-foreground: oklch(0.7058 0 0);            /* Muted text */
  --accent: oklch(0.2795 0.0368 260.031);           /* Accent background */
  --accent-foreground: oklch(0.7857 0.1153 246.6596); /* Accent text */

  /* Legacy color mappings for backward compatibility */
  --primary-color: var(--primary);
  --background-color: var(--background);
  --surface-color: var(--card);
  --border-color: var(--border);
  --text-primary: var(--foreground);
  --text-secondary: var(--muted-foreground);
  --text-muted: var(--muted-foreground);

  /* Status Colors */
  --success-color: #4CAF50;
  --warning-color: #FF9800;
  --error-color: #F44336;
  --info-color: var(--primary);

  /* Typography - Helvetica like web-frontend */
  --font-family-sans: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;

  /* Font Sizes */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */

  /* Spacing */
  --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 */

  /* Border Radius - Matching web-frontend */
  --radius: 0.875rem;               /* Base radius (14px) */
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Layout */
  --header-height: 4rem;
  --sidebar-width: 280px;
  --content-max-width: 90vw; /* Dynamic width: 90% of viewport width */

  /* Z-index */
  --z-header: 1000;
  --z-sidebar: 900;
  --z-modal: 1100;
  --z-tooltip: 1200;

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

  /* Gray Scale — dark-theme calibrated */
  --gray-50:  #1e2530;   /* Subtle surface — slightly lighter than page bg */
  --gray-400: #52596b;   /* Medium gray — badge and pill backgrounds */
  --gray-600: #3c4455;   /* Slightly darker — hover states */
  --gray-700: #2e3547;   /* Dark — button backgrounds */
  --gray-800: #1c2235;   /* Very dark — code header background */
  --gray-900: #0f1218;   /* Deepest dark — code block body */
}

/* Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--foreground);
  background-color: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.025em;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-4) 0;
  font-weight: 600;
  line-height: 1.3;
  color: var(--foreground);
}

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

p {
  margin: 0 0 var(--space-4) 0;
  line-height: 1.7;
}

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

a:hover {
  color: var(--accent-foreground);
  text-decoration: underline;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  z-index: var(--z-header);
  box-shadow: 0px 2px 5px 0px hsl(0 0% 0% / 0.57);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--space-6);
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-brand .brand-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--foreground);
  text-decoration: none;
}

.brand-logo {
  height: 3rem;
  width: auto;
  object-fit: contain;
}

.brand-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

/* Header Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.header-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  color: var(--foreground);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.header-nav .nav-link:hover {
  background: var(--muted);
  color: var(--primary);
  text-decoration: none;
}

.header-nav .nav-link.active {
  background: var(--primary);
  color: var(--primary-foreground);
}

.header-nav .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}

/* Footer */
.main-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: var(--space-8);
  text-align: center;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  margin-top: auto;
}

.footer-content p {
  margin: var(--space-2) 0;
}

.footer-content a {
  color: var(--primary);
  text-decoration: none;
}

.footer-content a:hover {
  text-decoration: underline;
  color: var(--accent-foreground);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Responsive Design */
@media (max-width: 1024px) {
  .nav-toggle {
    display: block;
  }

  .header-nav .nav-link {
    display: none;
  }
}

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

  .brand-text {
    max-width: 200px;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 var(--space-3);
  }

  .brand-logo {
    height: 2.5rem;
  }
}

/* Print Styles */
@media print {
  .site-header,
  .main-footer {
    display: none !important;
  }

  a {
    color: var(--text-primary) !important;
    text-decoration: none !important;
  }
}
