/* ==========================================================================
   Navbar Component - Dětské centrum Liberec
   UPDATED: Improved alignment, active states, hover effects, mobile
   ========================================================================== */

/* CSS Variables for consistent theming */
:root {
  --navbar-height: 76px;
  --navbar-bg: #ffffff;
  --navbar-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  --primary-color: #993366;
  --primary-hover: #7a2952;
  --primary-light: rgba(153, 51, 102, 0.08);
  --primary-lighter: rgba(153, 51, 102, 0.04);
  --text-color: #2d2d2d;
  --text-muted: #5a5a5a;
  --link-hover: #993366;
  --container-max: 1200px;
  --font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--text-color);
}

/* ==========================================================================
   Navbar - Main Container
   ========================================================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: var(--navbar-bg);
  box-shadow: var(--navbar-shadow);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Inner container - ALIGNED with page content (1200px) */
.navbar__container {
  width: 100%;
  max-width: var(--container-max);
  height: 100%;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   Logo Section
   ========================================================================== */

.navbar__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.25s ease;
  padding: 8px 0;
}

.navbar__logo:hover {
  opacity: 0.85;
}

.navbar__logo:focus {
  outline: none;
}

.navbar__logo:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
  border-radius: 4px;
}

.navbar__logo-image {
  height: auto;
  /* Keep logo comfortably inside the fixed navbar height */
  max-height: 95px;
  width: auto;
  max-width: 300px;
  display: block;
  object-fit: contain;
}

/* ==========================================================================
   Navigation Section
   ========================================================================== */

.navbar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar__links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.navbar__links li {
  display: flex;
}

/* ==========================================================================
   Navigation Links - IMPROVED Hover & Active States
   ========================================================================== */

.navbar__link {
  position: relative;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 10px 14px;
  border-radius: 8px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

/* Remove browser default focus styles */
.navbar__link:focus {
  outline: none;
}

.navbar__link:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Hover State - Color change + subtle background */
.navbar__link:hover {
  color: var(--primary-color);
  background: var(--primary-lighter);
}

/* Active State - Brand color with underline indicator */
.navbar__link--active {
  color: var(--primary-color);
  font-weight: 600;
  background: var(--primary-light);
}

/* Underline indicator for active link */
.navbar__link--active::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--primary-color);
  border-radius: 1px;
}

/* Hover on active link */
.navbar__link--active:hover {
  background: var(--primary-light);
}

/* ==========================================================================
   CTA Button - IMPROVED Hover Effects
   ========================================================================== */

.navbar__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 999px;
  margin-left: 20px;
  white-space: nowrap; /* prevent "Chci se přihlásit" from breaking into 2 lines */
  line-height: 1;      /* tighter vertical centering for single-line label */
  flex-shrink: 0;      /* don't squeeze the CTA and force wrapping */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(153, 51, 102, 0.25);
}

/* Remove browser default focus styles */
.navbar__cta:focus {
  outline: none;
}

.navbar__cta:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 3px;
}

/* Hover State - Darken + lift + stronger shadow */
.navbar__cta:hover {
  background: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(153, 51, 102, 0.35);
}

/* Active/Click State */
.navbar__cta:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(153, 51, 102, 0.3);
}

/* ==========================================================================
   Mobile Menu Toggle (Hamburger)
   ========================================================================== */

.navbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.navbar__toggle:hover {
  background: var(--primary-lighter);
}

.navbar__toggle:focus {
  outline: none;
}

.navbar__toggle:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.navbar__toggle-bar {
  width: 22px;
  height: 2.5px;
  background: var(--text-color);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar__toggle-bar:nth-child(2) {
  margin: 5px 0;
  width: 18px;
}

/* Hamburger to X animation */
.navbar__toggle--active .navbar__toggle-bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.navbar__toggle--active .navbar__toggle-bar:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.navbar__toggle--active .navbar__toggle-bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ==========================================================================
   Content Spacer (prevents content from hiding behind fixed navbar)
   ========================================================================== */

.navbar-spacer {
  height: var(--navbar-height);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Large screens - slightly reduce link padding */
@media (max-width: 1200px) {
  .navbar__container {
    padding: 0 24px;
  }

  .navbar__link {
    padding: 10px 12px;
    font-size: 13px;
  }

  .navbar__link--active::after {
    left: 12px;
    right: 12px;
  }

  .navbar__cta {
    padding: 11px 18px;
    font-size: 13px;
    margin-left: 12px;
  }
}

/* Tablet - Show hamburger menu */
@media (max-width: 1024px) {
  .navbar__toggle {
    display: flex;
  }

  .navbar__nav {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--navbar-bg);
    flex-direction: column;
    padding: 24px;
    gap: 8px;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  }

  .navbar__nav--open {
    transform: translateX(0);
  }

  /* Overlay when menu is open */
  .navbar__nav::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    z-index: -1;
  }

  .navbar__nav--open::before {
    opacity: 1;
    pointer-events: auto;
  }

  .navbar__links {
    flex-direction: column;
    width: 100%;
    gap: 4px;
  }

  .navbar__links li {
    width: 100%;
  }

  .navbar__link {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    border-radius: 12px;
    text-align: left;
  }

  .navbar__link--active::after {
    bottom: 14px;
    left: 20px;
    right: auto;
    width: 24px;
  }

  .navbar__cta {
    width: 100%;
    margin-left: 0;
    margin-top: 16px;
    padding: 16px 24px;
    font-size: 16px;
    justify-content: center;
  }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  .navbar__nav {
    padding: 20px;
  }

  .navbar__link {
    padding: 14px 18px;
    font-size: 15px;
  }

  .navbar__cta {
    padding: 14px 20px;
    font-size: 15px;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .navbar__container {
    padding: 0 16px;
  }

  .navbar__logo-image {
    max-height: 40px;
    max-width: 250px;
  }

  .navbar__toggle {
    width: 40px;
    height: 40px;
  }
}

/* ==========================================================================
   Accessibility - Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .navbar__link,
  .navbar__cta,
  .navbar__toggle,
  .navbar__toggle-bar,
  .navbar__nav {
    transition: none;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
  .navbar {
    position: static;
    box-shadow: none;
  }

  .navbar__toggle,
  .navbar__cta {
    display: none;
  }
}
