/* Navbar Styles - Updated Layout with Ocean Wave Effect */

/* Dropdown Overlay */
.dropdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.dropdown-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Enhanced Navbar Styles with Ocean Effect */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 80px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  position: relative;
}

/* Ocean Wave Effect - Seamless looping waves */
.navbar::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 0;
  width: 200%;
  height: 50px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 198'%3E%3Cpath d='M-8,95 C237,129 514,129 800,95 C1086,61 1363,61 1608,95 L1608,198 L-8,198 Z' fill='%23ffffff' fill-opacity='0.4'/%3E%3C/svg%3E") repeat-x;
  transform: translate3d(0, 0, 0);
  animation: wave-loop 12s linear infinite;
  pointer-events: none;
  z-index: 1;
}

.navbar::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 200%;
  height: 35px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 198'%3E%3Cpath d='M-8,95 C237,129 514,129 800,95 C1086,61 1363,61 1608,95 L1608,198 L-8,198 Z' fill='%23ffffff' fill-opacity='0.25'/%3E%3C/svg%3E") repeat-x;
  transform: translate3d(0, 0, 0);
  animation: swell-loop 8s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes wave-loop {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

@keyframes swell-loop {
  0% { transform: translate3d(0, -8px, 0); }
  25% { transform: translate3d(-12.5%, 5px, 0); }
  50% { transform: translate3d(-25%, -8px, 0); }
  75% { transform: translate3d(-37.5%, 5px, 0); }
  100% { transform: translate3d(-50%, -8px, 0); }
}

/* NEW LAYOUT: Language Left, Brand Center, Fish Right */
.navbar .container-fluid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 10;
}

/* ===== BRAND WITH AQUARIUM EFFECT - CENTER ===== */
.navbar-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.6rem;
  font-weight: 700;
  color: white !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.navbar-brand:hover {
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  color: white !important;
}

/* CSS-Only Aquarium with Fish */
.navbar-brand::before {
  content: '🐠';
  display: inline-block;
  position: relative;
  width: 45px;
  height: 45px;
  margin-right: 0.5rem;
  line-height: 41px;
  text-align: center;
  font-size: 1.4rem;
  border: 2px solid #FFFFFF;
  box-shadow: 
    0 0 0 2px #4973ff,
    inset 0 0 15px rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.4) 2px, transparent 2px),
    radial-gradient(circle at 75% 20%, rgba(255, 255, 255, 0.3) 1.5px, transparent 1.5px),
    radial-gradient(circle at 60% 70%, rgba(255, 255, 255, 0.35) 1px, transparent 1px),
    radial-gradient(circle at 30% 80%, rgba(255, 255, 255, 0.25) 1.5px, transparent 1.5px),
    linear-gradient(45deg, rgba(255, 255, 255, 0.1) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.1) 75%),
    linear-gradient(135deg, #2C74B3 0%, #4973ff 100%);
  background-size: 
    45px 45px, 45px 45px, 45px 45px, 45px 45px, 
    10px 10px, 
    100% 100%;
  animation: 
    aquariumBubbles 6s ease-in-out infinite,
    fishFloat 3s ease-in-out infinite;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  vertical-align: middle;
  z-index: 15;
}

/* Aquarium animations */
@keyframes aquariumBubbles {
  0%, 100% {
    background-position: 
      0px 0px, 10px 10px, 5px 5px, 8px 8px,
      0px 0px, 0px 0px;
  }
  25% {
    background-position: 
      2px -3px, 12px 7px, 7px 2px, 6px 11px,
      2px 2px, 0px 0px;
  }
  50% {
    background-position: 
      0px -8px, 15px 3px, 10px -2px, 3px 15px,
      5px 5px, 0px 0px;
  }
  75% {
    background-position: 
      -2px -5px, 8px 8px, 3px 5px, 9px 6px,
      8px 2px, 0px 0px;
  }
}

@keyframes fishFloat {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-1px) scale(1.05);
  }
}

.navbar-brand:hover::before {
  animation-duration: 2s;
  box-shadow: 
    0 0 0 2px #4973ff,
    0 0 15px rgba(73, 115, 255, 0.5),
    inset 0 0 15px rgba(0, 0, 0, 0.3);
}

/* Language Selector - LEFT SIDE */
.language-selector {
  position: relative;
  order: 1;
  z-index: 10;
}

.language-selector-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-weight: 600;
  padding: 0.5rem;
  border-radius: 28px;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 60px;
  height: 50px;
  min-width: 60px;
}

.language-selector-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.current-language {
  display: flex;
  align-items: center;
  justify-content: center;
}

.current-language-flag {
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
  border-radius: 2px;
}

/* Language Dropdown */
.language-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0;
  width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.language-selector.active .language-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 0.9rem;
  gap: 10px;
}

.language-dropdown-item:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  transform: translateX(5px);
}

.language-dropdown-item.active {
  background: rgba(102, 126, 234, 0.15);
  color: #667eea;
  font-weight: 600;
}

.language-flag {
  width: 24px;
  height: 18px;
  object-fit: contain;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.language-info {
  display: flex;
  flex-direction: column;
}

.language-name {
  font-weight: 600;
  margin-bottom: 0.1rem;
}

/* Fish Selector - RIGHT SIDE */
.fish-selector {
  position: relative;
  order: 3;
  margin-left: auto;
  z-index: 10;
}

.fish-selector-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: 35px;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 85px;
  height: 60px;
  min-width: 85px;
}

.fish-selector-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.fish-selector-btn::after {
  display: none;
}

.current-fish-icon {
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.current-fish {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.current-fish-emoji {
  font-size: 1.2rem;
}

/* Fish Dropdown - OPTIMIZED FOR PERFORMANCE */
.fish-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0;
  width: 200px;
  max-height: 300px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 9999;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.fish-selector.active .fish-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Optimized scrollbar */
.fish-dropdown::-webkit-scrollbar {
  width: 6px;
}

.fish-dropdown::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.fish-dropdown::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 3px;
}

.fish-dropdown::-webkit-scrollbar-thumb:hover {
  background: #5a6fd8;
}

.fish-dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 0.9rem;
  gap: 8px;
}

.fish-dropdown-item:hover {
  background: #f8f9ff;
  color: #555;
}

.fish-dropdown-item.active {
  background: #e8ecff;
  color: #667eea;
  font-weight: 600;
}

.fish-dropdown-item .fish-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin-right: 8px;
  flex-shrink: 0;
  image-rendering: auto;
}

.fish-dropdown-item .fish-emoji {
  font-size: 1.2rem;
  margin-right: 0.8rem;
}

.fish-dropdown-item .fish-info {
  display: flex;
  flex-direction: column;
}

.fish-dropdown-item .fish-name {
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.fish-dropdown-item .fish-desc {
  font-size: 0.8rem;
  color: #666;
  opacity: 0.8;
}

/* Remove old selector-container styles */
.selector-container {
  display: none;
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
  .navbar {
    height: auto;
    min-height: 80px;
    padding: 1rem 0;
  }
  
  .navbar .container-fluid {
    flex-wrap: nowrap;
  }
  
  .navbar-brand {
    position: static;
    transform: none;
    order: 2;
    flex: 1;
    text-align: center;
    margin: 0 1rem;
  }
  
  .navbar-brand::before {
    width: 35px;
    height: 35px;
    line-height: 31px;
    font-size: 1.2rem;
  }
  
  .language-selector {
    order: 1;
  }
  
  .fish-selector {
    order: 3;
    margin-left: 0;
  }
  
  .language-selector-btn {
    width: 50px;
    height: 45px;
    min-width: 50px;
  }
  
  .fish-selector-btn {
    width: 70px;
    height: 50px;
    min-width: 70px;
  }
  
  .language-dropdown {
    min-width: 150px;
    left: -5px;
  }
  
  .fish-dropdown {
    right: -5px;
    min-width: 180px;
  }
}

@media (max-width: 576px) {
  .navbar {
    height: 70px;
    min-height: 70px;
  }
  
  .navbar-brand {
    font-size: 1.3rem;
    margin: 0 0.5rem;
  }
  
  .navbar-brand::before {
    width: 30px;
    height: 30px;
    line-height: 26px;
    font-size: 1rem;
  }
  
  .language-selector-btn {
    width: 45px;
    height: 40px;
    min-width: 45px;
    padding: 0.3rem;
    border-radius: 20px;
  }
  
  .current-language-flag {
    width: 20px;
    height: 15px;
  }
  
  .fish-selector-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    width: 60px;
    height: 40px;
    min-width: 60px;
    border-radius: 20px;
  }
  
  .language-dropdown {
    min-width: 140px;
    left: -10px;
  }
  
  .fish-dropdown {
    min-width: 160px;
    right: -10px;
    max-height: 250px;
  }
  
  .language-dropdown-item {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .fish-dropdown-item {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
  
  .language-flag {
    width: 20px;
    height: 15px;
  }
  
  .navbar::after {
    height: 35px;
    bottom: -15px;
  }
  
  .navbar::before {
    height: 25px;
    bottom: -8px;
  }
}