/* Redixel TV - Navigation & Menu Styles
   Extracted from index.html for maintainability
   Includes mobile animations, dropdown, and active states */

/* Responsive Navigation */
.nav {
  justify-content: space-between;
  padding: 15px 5%;
  flex-wrap: nowrap;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.nav-menu {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-grow: 1;
  justify-content: center;
  min-width: 0;
  transition: all 0.3s ease;
}

.nav-link {
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
  display: inline-block;
  color: inherit;
  text-decoration: none;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: #e50914;
  transition: width 0.2s ease;
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  width: 100%;
}

.nav-cta {
  padding: 12px 24px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 15px;
}

/* Navigation Dropdown */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  cursor: pointer;
  user-select: none;
}

.dropdown-toggle i {
  transition: transform 0.2s ease;
  display: inline-block;
  margin-left: 4px;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(15, 15, 15, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(229, 9, 20, 0.3);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  min-width: 180px;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.nav-dropdown:hover .dropdown-menu {
  display: block;
}

.nav-dropdown.active .dropdown-toggle i {
  transform: rotate(180deg);
}

.dropdown-link {
  display: block;
  padding: 10px 16px;
  color: #fff;
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 0;
  white-space: nowrap;
}

.dropdown-link:hover {
  background: rgba(229, 9, 20, 0.1);
  color: #e50914;
  text-decoration: none;
}

.dropdown-link:first-child {
  border-radius: 8px 8px 0 0;
}

.dropdown-link:last-child {
  border-radius: 0 0 8px 8px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  margin-right: 15px;
  width: 30px;
  height: 22px;
  position: relative;
  z-index: 50;
}

.hamburger-line {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: white;
  border-radius: 3px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
}

.hamburger-line:nth-child(1) {
  top: 0px;
}

.hamburger-line:nth-child(2) {
  top: 9px;
}

.hamburger-line:nth-child(3) {
  top: 18px;
}

/* Animate to X when menu is open */
.menu-toggle.active .hamburger-line:nth-child(1) {
  top: 9px;
  transform: rotate(135deg);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
  left: -30px;
}

.menu-toggle.active .hamburger-line:nth-child(3) {
  top: 9px;
  transform: rotate(-135deg);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Menu Backdrop */
.menu-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 40;
  animation: fadeIn 0.2s ease;
}

.menu-backdrop.active {
  display: block;
}

/* Tablet Media Query */
@media (min-width: 769px) and (max-width: 1024px) {
  .nav {
    max-width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
  }

  .nav-menu {
    gap: 10px;
    justify-content: center;
    flex-grow: 1;
    min-width: 0;
  }

  .nav-link {
    padding: 6px 10px;
    font-size: 14px;
  }

  .nav-cta {
    padding: 10px 20px;
    font-size: 14px;
    flex-shrink: 0;
    white-space: nowrap;
    margin-left: 15px;
  }
}

/* Mobile Media Query */
@media (max-width: 768px) {
  .nav {
    padding: 15px 3%;
    max-width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    position: relative;
  }

  .logo {
    flex-shrink: 0;
  }

  .menu-toggle {
    display: block;
    order: 2;
    margin: 0 15px;
    align-self: center;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    background: rgba(15, 15, 15, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(229, 9, 20, 0.3);
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: all 0.3s ease;
  }

  .nav-menu.active {
    display: flex;
    animation: slideDown 0.3s ease-out;
  }

  .nav-cta {
    order: 3;
    margin-left: 0;
    flex-shrink: 0;
    white-space: nowrap;
    position: relative;
    z-index: 1001;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    padding: 10px;
  }

  .nav-link::after {
    display: none;
  }

  /* Mobile dropdown styles */
  .nav-dropdown {
    position: static;
    display: block;
    width: 100%;
  }

  .nav-dropdown:hover .dropdown-menu {
    display: none; /* Disable hover on mobile */
  }

  .dropdown-menu {
    position: static;
    display: none;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    min-width: auto;
    padding-left: 0;
    margin-top: 5px;
  }

  .nav-dropdown.active .dropdown-menu {
    display: block;
  }

  .dropdown-link {
    padding: 8px 20px;
    margin: 2px 0;
    border-radius: 6px;
    background: rgba(229, 9, 20, 0.05);
    border: 1px solid rgba(229, 9, 20, 0.15);
  }

  .dropdown-link:first-child,
  .dropdown-link:last-child {
    border-radius: 6px;
  }
}

/* Small Mobile Media Query */
@media (max-width: 480px) {
  .nav {
    padding: 12px 2%;
    max-width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
  }

  .logo {
    padding: 8px 0 !important;
    flex-shrink: 0;
  }

  #brandText {
    font-size: 18px;
  }

  .nav-cta {
    padding: 8px 16px;
    font-size: 12px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .menu-toggle {
    margin: 0 10px;
    align-self: center;
  }
}
