/* Modern V2Melody Menu Styles - Enhanced Version */
:root {
  --menu-primary-color: #667eea;
  --menu-primary-hover: #764ba2;
  --menu-primary-active: #5a6fd8;
  --menu-secondary-color: #764ba2;
  --menu-secondary-hover: #6a4190;
  --menu-accent-color: #f39c12;
  --menu-accent-hover: #e67e22;
  --menu-donate-color: #ffcc00;
  --menu-donate-hover: #f39c12;
  --menu-text-light: #ffffff;
  --menu-text-dark: #2c3e50;
  --menu-text-donate: #e8131d;
  --menu-shadow-light: rgba(102, 126, 234, 0.1);
  --menu-shadow-medium: rgba(102, 126, 234, 0.2);
  --menu-shadow-heavy: rgba(102, 126, 234, 0.3);
  --menu-border-radius: 12px;
  --menu-border-radius-large: 20px;
  --menu-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --menu-transition-fast: all 0.15s ease-out;
}

/* Header Container */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--menu-primary-color) 0%, var(--menu-secondary-color) 100%);
  box-shadow: 0 4px 20px var(--menu-shadow-medium);
  position: relative;
  z-index: 100;
  min-height: 80px;
}

/* Logo Container */
.logo-container {
  flex-shrink: 0;
  margin-right: 32px;
  transition: var(--menu-transition);
}

.logo-container:hover {
  transform: scale(1.02);
}

.logo {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 4px var(--menu-shadow-light));
}

/* Main Menu */
.v2m-menu {
  flex-grow: 0;
}

.v2m-menu ul {
  list-style: none;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0;
  margin: 0;
  align-items: center;
}

.v2m-menu li {
  position: relative;
}

/* Menu Items */
.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  color: var(--menu-text-light);
  text-decoration: none;
  border-radius: var(--menu-border-radius);
  font-size: 1rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--menu-transition);
  position: relative;
  overflow: hidden;
  min-height: 48px;
  min-width: 48px;
}

.menu-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: var(--menu-transition);
}

.menu-item:hover::before {
  left: 100%;
}

.menu-item:hover,
.menu-item:focus {
  background: rgba(255, 255, 255, 0.2);
  color: var(--menu-text-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--menu-shadow-medium);
  border-color: rgba(255, 255, 255, 0.3);
}

.menu-item:active {
  transform: translateY(0);
  transition: var(--menu-transition-fast);
}

.menu-item.active {
  background: var(--menu-primary-active);
  color: var(--menu-text-light);
  box-shadow: 0 4px 15px rgba(26, 188, 156, 0.4);
  border-color: rgba(255, 255, 255, 0.4);
}

.menu-item.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--menu-text-light);
  border-radius: 2px;
}

/* Menu Text */
.menu-text {
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Icons */
.v2m-menu i {
  width: 20px;
  text-align: center;
  font-size: 1.1em;
  transition: var(--menu-transition);
}

.menu-item:hover i {
  transform: scale(1.1);
}

/* Account Menu */
.account-item {
  background: var(--menu-secondary-color) !important;
  border-color: rgba(231, 76, 60, 0.3) !important;
}

.account-item:hover {
  background: var(--menu-secondary-hover) !important;
  border-color: rgba(192, 57, 43, 0.4) !important;
}

/* Donate Button */
.donate-item {
  background: var(--menu-donate-color) !important;
  color: var(--menu-text-donate) !important;
  border-color: rgba(255, 204, 0, 0.3) !important;
  font-weight: 600;
}

.donate-item:hover {
  background: var(--menu-donate-hover) !important;
  color: var(--menu-text-light) !important;
  border-color: rgba(243, 156, 18, 0.4) !important;
}

.donate-item i {
  color: var(--menu-secondary-color) !important;
}

.donate-item:hover i {
  color: var(--menu-text-light) !important;
}

/* Mobile Controls */
.mobile-controls {
  display: none;
  align-items: center;
  gap: 12px;
  order: 3;
}

.mobile-menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--menu-text-light);
  padding: 12px;
  border-radius: var(--menu-border-radius);
  cursor: pointer;
  font-size: 1.2em;
  transition: var(--menu-transition);
  backdrop-filter: blur(10px);
  min-width: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
}

.mobile-menu-toggle[aria-expanded="true"] {
  background: var(--menu-primary-active);
  border-color: rgba(26, 188, 156, 0.4);
}

.mobile-account-icon,
.mobile-donate-icon {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--menu-border-radius);
  text-decoration: none;
  font-weight: 500;
  transition: var(--menu-transition);
  min-height: 48px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-account-icon {
  background: var(--menu-secondary-color);
  color: var(--menu-text-light);
  border-color: rgba(231, 76, 60, 0.3);
}

.mobile-account-icon:hover {
  background: var(--menu-secondary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.mobile-donate-icon {
  background: var(--menu-donate-color);
  color: var(--menu-text-donate);
  border-color: rgba(255, 204, 0, 0.3);
  font-weight: 600;
}

.mobile-donate-icon:hover {
  background: var(--menu-donate-hover);
  color: var(--menu-text-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3);
}

.mobile-text {
  font-size: 0.9rem;
  display: inline-block !important; /* Force show text on mobile */
}

/* Medium Screen Styles - Handle menu overflow */
@media (max-width: 1624px) {
  .header-container {
    padding: 12px 16px;
  }

  .logo-container {
    margin-right: 16px;
  }

  .logo {
    max-width: 200px;
  }

  .v2m-menu ul {
    gap: 8px;
  }

  .menu-item {
    padding: 10px 14px;
    font-size: 0.9rem;
    min-width: 40px;
  }

  .menu-text {
    font-size: 0.85rem;
  }

  .v2m-menu i {
    font-size: 1em;
  }
}

/* Small Medium Screen Styles */
@media (max-width: 1400px) {
  .header-container {
    padding: 10px 12px;
  }

  .logo {
    max-width: 180px;
  }

  .v2m-menu ul {
    gap: 6px;
  }

  .menu-item {
    padding: 8px 12px;
    font-size: 0.85rem;
    min-width: 36px;
  }

  .menu-text {
    font-size: 0.8rem;
  }
}

/* Compact Menu Styles */
@media (max-width: 1200px) {
  .header-container {
    padding: 8px 10px;
  }

  .logo {
    max-width: 160px;
  }

  .logo-container {
    margin-right: 12px;
  }

  .v2m-menu ul {
    gap: 4px;
  }

  .menu-item {
    padding: 6px 10px;
    font-size: 0.8rem;
    min-width: 32px;
  }

  .menu-text {
    font-size: 0.75rem;
  }

  .v2m-menu i {
    font-size: 0.9em;
  }
}

/* Very Compact Menu Styles - Hide some text to prevent overflow */
@media (max-width: 1100px) {
  .header-container {
    padding: 6px 8px;
  }

  .logo {
    max-width: 140px;
  }

  .logo-container {
    margin-right: 8px;
  }

  .v2m-menu ul {
    gap: 3px;
  }

  .menu-item {
    padding: 5px 8px;
    font-size: 0.75rem;
    min-width: 28px;
  }

  .menu-text {
    font-size: 0.7rem;
  }

  .v2m-menu i {
    font-size: 0.85em;
  }

  /* Hide text for less important menu items to save space */
  .menu-item:not(.account-item):not(.donate-item) .menu-text {
    display: none;
  }

  /* Add tooltips for icon-only items */
  .menu-item:not(.account-item):not(.donate-item) {
    position: relative;
  }

  .menu-item:not(.account-item):not(.donate-item):hover::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 1000;
  }
}

/* Mobile Styles */
@media (max-width: 1000px) {
  .header-container {
    flex-wrap: wrap;
    flex-direction: column;
    padding: 12px 16px;
    min-height: auto;
  }

  .logo-container {
    display: none;
    margin: 0 auto 16px;
    order: 1;
  }

  .mobile-controls {
    display: flex;
    margin-bottom: 12px;
    z-index: 300;
    width: 100%;
    justify-content: space-between;
  }

  .mobile-donate-icon,
  .mobile-account-icon {
    display: flex !important;
  }

  .mobile-menu-toggle {
    display: flex !important;
  }

  .v2m-menu ul {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 20px;
    background: linear-gradient(135deg, var(--menu-primary-color) 0%, #2c5f7a 100%);
    border-radius: var(--menu-border-radius-large);
    box-shadow: 0 20px 60px var(--menu-shadow-heavy);
    position: fixed;
    right: 20px;
    top: 120px;
    min-width: 280px;
    max-width: 90vw;
    display: none;
    z-index: 400;
    transition: var(--menu-transition);
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .v2m-menu ul.show {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  .v2m-menu li {
    width: 100%;
  }

  .menu-item {
    width: 100%;
    justify-content: flex-start;
    font-size: 1.1rem;
    padding: 16px 20px;
    border-radius: var(--menu-border-radius);
    margin: 2px 0;
    min-height: 56px;
  }

  .menu-text {
    font-size: 1rem;
    display: inline-block !important; /* Force show text on mobile */
  }
  
  /* Override text hiding for mobile - show all menu text */
  .menu-item .menu-text {
    display: inline-block !important;
  }

  /* Overlay */
  .v2m-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 350;
    transition: var(--menu-transition);
    opacity: 0;
  }

  .v2m-menu-overlay.show {
    display: block;
    opacity: 1;
  }
}

@media (max-width: 600px) {
  .header-container {
    padding: 8px 12px;
  }

  .mobile-controls {
    margin-bottom: 8px;
    gap: 8px;
  }

  .v2m-menu ul {
    min-width: 260px;
    max-width: 95vw;
    padding: 16px;
    right: 10px;
    top: 100px;
  }

  .menu-item {
    font-size: 1rem;
    padding: 14px 16px;
    min-height: 52px;
  }

  .mobile-menu-toggle {
    font-size: 1.1em;
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
  }

  .mobile-account-icon,
  .mobile-donate-icon {
    padding: 8px 12px;
    min-height: 44px;
    font-size: 0.9rem;
  }

  .mobile-text {
    font-size: 0.85rem;
  }
  
  /* Override text hiding for mobile - show all menu text */
  .menu-item .menu-text {
    display: inline-block !important;
  }
}

/* Focus Management */
.menu-item:focus-visible {
  outline: 2px solid var(--menu-text-light);
  outline-offset: 2px;
}

.mobile-menu-toggle:focus-visible {
  outline: 2px solid var(--menu-text-light);
  outline-offset: 2px;
}

/* Animation for menu items */
@keyframes menuItemFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.v2m-menu ul.show .menu-item {
  animation: menuItemFadeIn 0.3s ease-out forwards;
}

.v2m-menu ul.show .menu-item:nth-child(1) { animation-delay: 0.1s; }
.v2m-menu ul.show .menu-item:nth-child(2) { animation-delay: 0.15s; }
.v2m-menu ul.show .menu-item:nth-child(3) { animation-delay: 0.2s; }
.v2m-menu ul.show .menu-item:nth-child(4) { animation-delay: 0.25s; }
.v2m-menu ul.show .menu-item:nth-child(5) { animation-delay: 0.3s; }
.v2m-menu ul.show .menu-item:nth-child(6) { animation-delay: 0.35s; }
.v2m-menu ul.show .menu-item:nth-child(7) { animation-delay: 0.4s; }
.v2m-menu ul.show .menu-item:nth-child(8) { animation-delay: 0.45s; }
.v2m-menu ul.show .menu-item:nth-child(9) { animation-delay: 0.5s; }

/* High contrast mode support */
@media (prefers-contrast: high) {
  .menu-item {
    border-width: 2px;
  }
  
  .menu-item.active {
    border-width: 3px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .menu-item,
  .mobile-menu-toggle,
  .mobile-account-icon,
  .mobile-donate-icon {
    transition: none;
  }
  
  .menu-item::before {
    display: none;
  }
  
  .v2m-menu ul.show .menu-item {
    animation: none;
  }
} 