/* FastAPI Portal - Theme Variables */

/* Light theme (default) */
:root, [data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f6f7f9;
  --bg-tertiary: #eef3f0;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border-color: #e5e7eb;
  --accent-color: #1e6f4f;
  --accent-hover: #165a3f;
  --error-color: #b00020;
  --success-color: #059669;
  --warning-color: #d97706;

  /* Header theme */
  --theme-header-bg: #1B5E3B;
  --theme-header-text: #ffffff;
  --theme-primary: #1B5E3B;
  --theme-radius: 12px;
}

/* Dark theme */
[data-theme="dark"] {
  --bg-primary: #1f2937;
  --bg-secondary: #111827;
  --bg-tertiary: #374151;
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  --border-color: #374151;
  --accent-color: #34d399;
  --accent-hover: #10b981;
  --error-color: #f87171;
  --success-color: #34d399;
  --warning-color: #fbbf24;

  /* Header theme dark */
  --theme-header-bg: #0f172a;
  --theme-header-text: #f1f5f9;
  --theme-primary: #34d399;
}

body {
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: background-color 0.2s, color 0.2s;
}

.container {
  background: var(--bg-primary);
}

/* =============================================================================
   HEADER STYLES
   ============================================================================= */

.site-header {
  background: var(--theme-header-bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  box-sizing: border-box;
}

/* Logo */
.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--theme-header-text);
  flex-shrink: 0;
}

.brand-name {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  color: var(--theme-header-text);
}

/* Navigation */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--theme-header-text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.15);
  text-decoration: none;
}

.nav-links a.active {
  background: rgba(255, 255, 255, 0.95);
  color: var(--theme-primary);
  font-weight: 600;
}

/* Dark theme nav */
[data-theme="dark"] .nav-links a:hover {
  background: rgba(52, 211, 153, 0.15);
}

[data-theme="dark"] .nav-links a.active {
  background: var(--theme-primary);
  color: #111827;
}

/* Header actions (right side) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--theme-radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--theme-header-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  text-decoration: none;
}

.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}

.header-bell {
  width: 20px;
  height: 20px;
  display: block;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--theme-header-bg);
  color: var(--theme-header-text);
  padding: 8px 16px;
  z-index: 200;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.breadcrumbs .crumb {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumbs .crumb:hover {
  color: var(--accent-color);
}

.breadcrumbs .crumb.current {
  color: var(--text-primary);
  font-weight: 500;
}

.breadcrumbs .crumb:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: var(--text-muted);
}

/* Main content area */
.main {
  min-height: calc(100vh - 60px);
  padding: 24px 0 40px;
}

/* Responsive header */
@media (max-width: 1200px) {
  .nav-links a {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
}

@media (max-width: 1024px) {
  .brand-name {
    display: none;
  }

  .nav-links a {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .header-inner {
    height: 52px;
    padding: 0 16px;
  }
}
