
/* ============================================
   EZKIFY HEADER RECOLOR & DARK MODE SYSTEM
   ============================================ */

/* CSS Variables for theming */
:root {
  /* Light Mode (Default) */
  --ez-header-bg: #ffffff;
  --ez-header-text: #111827;
  --ez-header-text-muted: #6b7280;
  --ez-header-border: #e5e7eb;
  --ez-header-link: #374151;
  --ez-header-link-hover: #6366f1;
  --ez-header-active: #6366f1;
  --ez-header-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --ez-toggle-bg: #e5e7eb;
  --ez-toggle-circle: #ffffff;
  --ez-toggle-icon: #f59e0b;

  /* Brand Colors (consistent across modes) */
  --ez-brand-primary: #6366f1;
  --ez-brand-secondary: #8b5cf6;
  --ez-brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --ez-header-bg: #0a0a14;
  --ez-header-text: #e2e8f0;
  --ez-header-text-muted: #94a3b8;
  --ez-header-border: #1e293b;
  --ez-header-link: #cbd5e1;
  --ez-header-link-hover: #6366f1;
  --ez-header-active: #6366f1;
  --ez-header-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  --ez-toggle-bg: #334155;
  --ez-toggle-circle: #1e293b;
  --ez-toggle-icon: #fbbf24;
}

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

/* Main Navbar Wrapper */
.component_navbar {
  background: var(--ez-header-bg) !important;
  border-bottom: 1px solid var(--ez-header-border);
  box-shadow: var(--ez-header-shadow);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Navbar Container */
.component-navbar__wrapper {
  background: transparent !important;
}

/* Navbar Base */
.navbar {
  background: var(--ez-header-bg) !important;
  padding: 0.75rem 1rem;
  transition: background-color 0.3s ease;
}

/* Logo/Brand */
.component-navbar-logo img {
  filter: none;
  transition: filter 0.3s ease;
  max-height: 45px;
  width: auto;
}

[data-theme="dark"] .component-navbar-logo img {
  filter: brightness(0) invert(1);
}

/* Navigation Links */
.component-navbar-nav-link {
  color: var(--ez-header-link) !important;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
}

.component-navbar-nav-link:hover {
  color: var(--ez-header-link-hover) !important;
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-1px);
}

.component-navbar-nav-link__navbar-public.component-navbar-nav-link-active__navbar-public {
  color: var(--ez-header-active) !important;
  background: rgba(99, 102, 241, 0.15);
  font-weight: 600;
}

/* Mobile Toggle Button */
.navbar-toggler {
  border: 2px solid var(--ez-header-border);
  background: var(--ez-header-bg);
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.navbar-toggler:hover {
  border-color: var(--ez-brand-primary);
  background: rgba(99, 102, 241, 0.1);
}

.navbar-burger-line,
.navbar-toggler-icon {
  background-color: var(--ez-header-text) !important;
}

/* ============================================
   DARK MODE TOGGLE BUTTON
   ============================================ */

.dark-mode-toggle {
  position: relative;
  width: 60px;
  height: 32px;
  background: var(--ez-toggle-bg);
  border-radius: 999px;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 1rem;
  transition: background-color 0.3s ease;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark-mode-toggle:hover {
  transform: scale(1.05);
}

.dark-mode-toggle:active {
  transform: scale(0.95);
}

/* Toggle Circle */
.toggle-circle {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  background: var(--ez-toggle-circle);
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Icons inside toggle */
.toggle-icon {
  font-size: 14px;
  transition: opacity 0.2s ease;
}

.sun-icon {
  color: #f59e0b;
  opacity: 1;
}

.moon-icon {
  color: #fbbf24;
  opacity: 0;
  position: absolute;
}

/* Dark mode active states */
[data-theme="dark"] .dark-mode-toggle .toggle-circle {
  transform: translateX(28px);
}

[data-theme="dark"] .sun-icon {
  opacity: 0;
}

[data-theme="dark"] .moon-icon {
  opacity: 1;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 991px) {
  .navbar-collapse {
    background: var(--ez-header-bg);
    border-radius: 12px;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--ez-header-border);
    box-shadow: var(--ez-header-shadow);
  }

  .dark-mode-toggle {
    margin: 1rem 0 0 0;
    align-self: flex-start;
  }

  .component-navbar-nav-link {
    padding: 0.75rem 1rem !important;
    margin-bottom: 0.25rem;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.component_navbar {
  animation: slideIn 0.3s ease-out;
}

/* Smooth theme transition for all elements */
*, *::before, *::after {
  transition: background-color 0.3s ease, 
              color 0.3s ease, 
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.dark-mode-toggle:focus-visible {
  outline: 2px solid var(--ez-brand-primary);
  outline-offset: 2px;
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
