/* Here is Part 2: The clean layout.css file.

This file now contains only the global variables, base resets, header navigation, mobile slide-in drawer, global alerts, structural wrappers, and the footer. */

/* /static/css/layout.css */

/* ==========================================================================
   1. Theme Variables & Base Settings (Shared)
   ========================================================================== */
:root {
  /* Elegant Dark Mode (Default) */
  --bg-body: #050810;
  --bg-card: #0f141f;
  --text-main: #f8fafc;
  --text-main-hero: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --footer-bg: #03050a;
  
  /* Brand Colors */
  --brand-neon: #a3e635; 
  /* --brand-neon: #6dff6d;  */
  /* --brand-neon: #00ff00;  */
  --card-icon-bg: rgba(203, 251, 69, 0.15);
  --brand-neon-glow: rgba(203, 251, 69, 0.15);
  --brand-neon-hover: #baf02d;
  /* --brand-neon-hover: #11de11; */
  --btn-text: #052028;
  --logo-bg: var(--brand-neon);
  --logo-color: #050810;

  /* Hero Bottom Light */
  --hero-glow-color: rgba(203, 251, 69, 0.25);
  
  /* Shared Structural Variables */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] {
  /* Bubbly, Lively Light Mode */
  --bg-body: #e7ffef; 
  /* --bg-body: #f1f5f9;  */
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-main-hero: #57b108; 
  /* --text-main-hero: #12b512;  */
  --text-muted: #64748b;
  --border-color: #e1ffeb;
  /* --border-color: #e2e8f0; */
  --footer-bg: #e1fbea;
  /* --footer-bg: #e2f5ea; */
  
  /* Brand tweaks for light mode contrast */
  --brand-neon: #54ad07; 
  /* --brand-neon: #0ebf0e;  */
  /* --brand-neon: #62c80a;  */
  --brand-neon-glow: rgba(163, 230, 53, 0.3);
  --card-icon-bg: #0f172a;
  --brand-neon-hover: #84cc16;
  /* --brand-neon-hover: #1bdf1b; */
  --btn-text: #ffffff;
  --logo-bg: #0f172a;
  --logo-color: #a3e635;
  /* --logo-color: #00ff00; */

  --hero-glow-color: rgba(163, 230, 53, 0.4);
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

/* * { Let Tailwind handle this.
  box-sizing: border-box;
  margin: 0;
  padding: 0;
} */

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==========================================================================
   2. Layout & Navigation (Upgraded with Desktop/Mobile responsiveness) Shared
   ========================================================================== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 5%;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--logo-bg);
  color: var(--bg-body);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.brand-name {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Desktop Navigation Links */
.desktop-nav {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--brand-neon);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px; 
}

.desktop-auth {
  display: flex;
  gap: 12px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 480px) { 
  .icon-btn {
    width: 32px;
    height: 32px;
    padding-left: 5px;
    padding-right: 5px;
  }
}
@media (max-width: 380px) { 
  .icon-btn {
    width: 28px;
    height: 28px;
    padding-right: 5px;
    padding-left: 5px;
  }
}

.icon-btn:hover {
  background: var(--border-color);
  color: var(--text-main);
  transform: scale(1.05);
}

/* Theme Icons Visibility */
[data-theme="dark"] .dark-icon { display: none; }
[data-theme="dark"] .light-icon { display: block; }
[data-theme="light"] .light-icon { display: none; }
[data-theme="light"] .dark-icon { display: block; }

.btn-outline {
  text-decoration: none;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-outline:hover {
  background: var(--border-color);
  transform: translateY(-2px);
}

/* Mobile & Tablet Overrides */
.mobile-only {
  display: none; 
}

@media (max-width: 991px) {
  .desktop-nav, 
  .desktop-auth {
    display: none; 
  }

  .mobile-only {
    display: flex; 
  }

  .navbar {
    padding: 16px 5%; 
  }

  .nav-actions {
    gap: 8px; 
  }

  .logo-icon {
    width: 38px;
    height: 38px;
  }
  .brand-name {
    font-size: 1rem;
  }
  .brand-tagline {
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .nav-actions {
    gap: 2px;
  }
  
  .navbar {
    padding-right: 4%; 
  }
}

/* ==========================================================================
   2.1 Mobile Slide-in Drawer & Overlay Animations
   ========================================================================== */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 40;
  opacity: 0;
  pointer-events: none; 
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
  pointer-events: auto; 
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%; 
  width: 300px;
  max-width: 85vw; 
  height: 100vh;
  background: var(--bg-body);
  border-left: 1px solid var(--border-color);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.175, 0.885, 0.32, 1); 
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
}

.mobile-menu.active {
  right: 0; 
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.logo-icon.small {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.mobile-menu-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
}

.mobile-nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.mobile-nav-link i {
  color: var(--brand-neon);
  width: 20px;
  height: 20px;
}

.mobile-nav-link:hover {
  background: var(--bg-card);
  color: var(--brand-neon);
}

.mobile-menu-footer {
  padding: 24px 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

.mobile-theme-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-main);
}


/* ==========================================================================
   3. Main Content & Global Alerts
   ========================================================================== */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 32px 5%;
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  .main-content {
    padding-top: 28px;
  }
}

@media (max-width: 380px) {
  .main-content {
    padding-top: 20px;
  }
}

/* Base style for standard auth panels (Login/Legacy Auth) */
.auth-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}

/* Global Flash Alerts */
.alert {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 0.9rem;
  font-weight: 600;
  align-items: center;
}

.alert-error {
  background: rgba(255, 107, 107, 0.1);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.2);
}

.alert-success {
  background: rgba(110, 231, 183, 0.1);
  color: #10b981;
  border: 1px solid rgba(110, 231, 183, 0.2);
}

/* ==========================================================================
   4. Footer Styling (Upgraded)
   ========================================================================== */
.site-footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--border-color);
  padding: 48px 5%;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand .brand-name {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text-main);
}

.footer-copyright {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 32px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-main);
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }
}