/* Card Nav Styles - адаптированные для Flask проекта */

.card-nav-container {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1200px;
  z-index: 100;
  box-sizing: border-box;
}

.card-nav {
  display: block;
  height: 80px;
  min-height: 80px;
  padding: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: visible;
  will-change: height;
  transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.card-nav.open {
  height: auto;
  min-height: 300px;
}

.card-nav.dark {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}

.card-nav-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 2;
}

.hamburger-menu {
  height: 40px;
  width: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  gap: 6px;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

.hamburger-menu:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.card-nav.dark .hamburger-menu:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.hamburger-menu:hover .hamburger-line {
  opacity: 0.75;
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background-color: currentColor;
  transition: transform 0.25s ease, opacity 0.2s ease, margin 0.3s ease;
  transform-origin: 50% 50%;
  border-radius: 1px;
}

.hamburger-menu.open .hamburger-line:first-child {
  transform: translateY(4px) rotate(45deg);
}

.hamburger-menu.open .hamburger-line:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.logo-container {
  display: flex;
  align-items: center;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  gap: 0.5rem;
}

.logo-container a {
  text-decoration: none !important;
  border: none !important;
  outline: none !important;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, hsl(158 64% 42%) 0%, hsl(158 64% 52%) 100%);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px hsl(158 64% 42% / 0.3);
  transition: all 0.3s ease;
}

.logo-icon:hover {
  box-shadow: 0 8px 24px hsl(158 64% 42% / 0.4);
  transform: translateY(-2px);
}

.logo-text {
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  font-size: 1.5rem;
  background: linear-gradient(135deg, hsl(158 64% 42%) 0%, hsl(158 64% 52%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.card-nav-cta-button {
  background: linear-gradient(135deg, hsl(158 64% 42%) 0%, hsl(158 64% 52%) 100%);
  color: white;
  border: none;
  border-radius: 0.75rem;
  padding: 0 1.5rem;
  height: 48px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px hsl(158 64% 42% / 0.3);
}

.card-nav-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px hsl(158 64% 42% / 0.4);
}

.card-nav-content {
  position: absolute;
  left: 0;
  right: 0;
  top: 80px;
  min-height: 200px;
  padding: 1rem;
  display: flex;
  align-items: stretch;
  gap: 1rem;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
}

.card-nav.open .card-nav-content {
  visibility: visible;
  pointer-events: auto;
}

.nav-card {
  flex: 1 1 0;
  min-width: 0;
  background: linear-gradient(135deg, hsl(158 64% 42% / 0.1) 0%, hsl(158 64% 42% / 0.05) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid hsl(158 64% 42% / 0.2);
  border-radius: 0.75rem;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1rem;
  user-select: none;
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: visible;
  opacity: 0;
  transform: translateY(20px);
}

.nav-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, hsl(158 64% 42%) 0%, hsl(158 64% 52%) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.nav-card:hover::before {
  opacity: 0.1;
}

.nav-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px hsl(158 64% 42% / 0.2);
  border-color: hsl(158 64% 42% / 0.3);
}

.nav-card-label {
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}

.nav-card-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-card-link {
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  opacity: 0.8;
}

.nav-card-link:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.nav-card-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, hsl(158 64% 42%) 0%, hsl(158 64% 52%) 100%);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px hsl(158 64% 42% / 0.3);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.nav-card:hover .nav-card-icon {
  transform: scale(1.1);
  box-shadow: 0 8px 24px hsl(158 64% 42% / 0.4);
}

.nav-card-link-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.nav-card-link:hover .nav-card-link-icon {
  transform: rotate(45deg);
}

/* Мобильная адаптация */
@media (max-width: 768px) {
  .card-nav-container {
    width: 95%;
    top: 0.5rem;
  }
  
  .card-nav-top {
    padding: 0 1rem;
    position: relative;
  }
  
  .logo-container {
    position: static;
    transform: none;
    flex: 1;
    justify-content: center;
    margin: 0;
  }
  
  .card-nav-cta-button {
    display: none;
  }
  
  .hamburger-menu {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
  
  .card-nav-content {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
  
  .nav-card {
    height: auto;
    min-height: 120px;
    padding: 1rem;
    flex: none;
    width: 100%;
    background: linear-gradient(135deg, hsl(158 64% 42% / 0.1) 0%, hsl(158 64% 42% / 0.05) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid hsl(158 64% 42% / 0.2);
  }
  
  .logo-text {
    font-size: 1.25rem;
  }
  
  .logo-icon {
    width: 36px;
    height: 36px;
  }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
  .card-nav-container {
    width: 98%;
    top: 0.25rem;
  }
  
  .card-nav-top {
    padding: 0 0.75rem;
  }
  
  .logo-container {
    margin: 0;
  }
  
  .logo-text {
    font-size: 1.1rem;
  }
  
  .logo-icon {
    width: 32px;
    height: 32px;
  }
  
  .card-nav-cta-button {
    display: none;
  }
  
  .hamburger-menu {
    width: 32px;
    height: 32px;
  }
  
  .hamburger-line {
    width: 20px;
  }
}

/* Анимации */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-card.animate {
  animation: slideInUp 0.4s ease forwards;
}

.nav-card.animate:nth-child(1) {
  animation-delay: 0.1s;
}

.nav-card.animate:nth-child(2) {
  animation-delay: 0.2s;
}

.nav-card.animate:nth-child(3) {
  animation-delay: 0.3s;
}