/* --- GLOBAL THEME VARIABLES --- */
:root {
  /* LIGHT THEME (High-Contrast Corporate Dashboard) */
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  --surface-glass: rgba(255, 255, 255, 0.95); 
  --surface-border: rgba(203, 213, 225, 0.6); 
  --text-main: #0f172a; 
  --text-muted: #475569;
  
  /* User Specific Button Tweaks */
  --btn-bg: rgba(205, 205, 205, 0.95);
  --btn-border: rgba(15, 32, 39, 0.95);
  
  /* Universal Dark Header */
  --header-bg: rgba(15, 32, 39, 0.95); 
  --header-text: #ffffff; 
  
  /* Universal Light Theme Glow (Soft Cyan) */
  --glow-base: rgba(0, 229, 255, 0.4); 
  
  /* Brand Constants (Matches CZ Logo) */
  --accent-c: #FF0000; /* Red */
  --accent-z: #00E5FF; /* Cyan */
}

[data-theme="neutral"] {
  /* NEUTRAL THEME (Beige/Wood/Blue Panels) */
  --bg-gradient: linear-gradient(135deg, #f5f5dc 0%, #d4b886 100%);
  --surface-glass: rgba(245, 245, 220, 0.65);
  --surface-border: rgba(15, 32, 39, 0.6); 
  --text-main: #0f172a;
  --text-muted: #4a4a3a;
  
  /* User Specific Button Tweaks */
  --btn-bg: rgba(212, 184, 134, 0.85);
  --btn-border: rgba(15, 32, 39, 0.6);
  
  /* Universal Dark Header */
  --header-bg: rgba(15, 32, 39, 0.95); 
  --header-text: #ffffff;
  
  /* Universal Neutral Theme Glow (Soft Cyan) */
  --glow-base: rgba(0, 229, 255, 0.4); 
}

[data-theme="dark"] {
  /* DARK THEME (Deep Slate / Teal) */
  --bg-gradient: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
  --surface-glass: rgba(15, 32, 39, 0.6);
  --surface-border: rgba(255, 255, 255, 0.15);
  --text-main: #ffffff;
  --text-muted: #b0bec5;
  
  /* Standard Dark Buttons */
  --btn-bg: rgba(0, 0, 0, 0.6);
  --btn-border: rgba(255, 255, 255, 0.15);
  
  /* Universal Dark Header */
  --header-bg: rgba(15, 32, 39, 0.95); 
  --header-text: #ffffff;
  
  /* Universal Dark Glow (Bright Cyan) */
  --glow-base: rgba(0, 229, 255, 0.5);
}

/* --- BASE STYLES & RESET --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transition: background 0.4s ease, color 0.4s ease;
}

main {
  flex: 1;
  padding: 1.5rem;
  padding-bottom: 100px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* --- GLASSMORPHISM UTILITIES --- */
.glass-panel {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
  transition: background 0.4s ease, border-color 0.4s ease;
}

/* --- HEADER COMPONENTS --- */
.top-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--header-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--surface-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  transition: background 0.4s ease, border-color 0.4s ease;
}

.header-logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo-img {
  height: 48px;
  width: auto;
}

.header-brand-text {
  color: var(--header-text);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 1px;
  transition: color 0.4s ease;
}

.header-menu-toggle {
  font-size: 1.8rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--header-text);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.4s ease, text-shadow 0.3s ease;
}

.header-menu-toggle:hover {
  text-shadow: 0 0 15px var(--glow-base);
}

/* --- UNIVERSAL INTERACTIVE ELEMENTS --- */
.box-btn, .network-card-link {
  background: var(--btn-bg);
  color: var(--text-main);
  
  /* Fine grey/theme border on top and bottom */
  border-top: 1px solid var(--btn-border);
  border-bottom: 1px solid var(--btn-border);
  
  /* Brand color anchors matching the CZ Logo */
  border-left: 3px solid var(--accent-c);  /* Red (C) Left */
  border-right: 3px solid var(--accent-z); /* Cyan (Z) Right */
  
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Specific Padding for Box Buttons */
.box-btn {
  padding: 1rem 1.5rem;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: inline-block;
}

/* Universal Dual-Glow Hover State */
.box-btn:hover, .network-card-link:hover {
  transform: translateY(-2px);
  /* Red glow emits left (-X), Cyan glow emits right (+X), plus base drop shadow */
  box-shadow: 
    -12px 0 25px -5px rgba(255, 0, 0, 0.4), 
    12px 0 25px -5px rgba(0, 229, 255, 0.4),
    0 8px 20px rgba(0, 0, 0, 0.15);
  /* Subtly brightens the top/bottom borders on hover */
  border-top-color: var(--text-muted);
  border-bottom-color: var(--text-muted);
}

.box-btn:active, .network-card-link:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* --- BOTTOM APP BAR --- */
.bottom-app-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 75px;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--surface-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
  transition: background 0.4s ease;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s, color 0.4s ease, text-shadow 0.3s ease;
}

.nav-btn:hover, .nav-btn:active {
  opacity: 1;
  color: var(--accent-z); /* Turns cyan on hover */
  text-shadow: 0 0 10px var(--glow-base);
}

.nav-btn .icon {
  font-size: 1.4rem;
}

/* --- RIGHT SLIDING DRAWER --- */
.side-drawer {
  position: fixed;
  top: 0;
  right: -320px; 
  width: 320px;
  height: 100vh;
  background: var(--surface-glass);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-left: 1px solid var(--surface-border);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s ease;
  z-index: 1100;
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.side-drawer.open {
  right: 0;
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1050;
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.theme-toggle-group {
  display: flex;
  justify-content: space-between;
  background: rgba(0,0,0,0.15);
  border-radius: 12px;
  padding: 6px;
}

.theme-icon {
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s, box-shadow 0.3s ease, border-color 0.3s ease;
  border: 1px solid transparent;
}

.theme-icon:hover {
  background: var(--surface-glass);
  border: 1px solid var(--accent-z);
  box-shadow: 0 0 15px var(--glow-base);
  color: var(--accent-z);
}