/**
 * Exploria - Mega Menu Styles
 * Additional styling for premium mega menu components
 * 
 * @package Exploria
 * @version 2.0.0
 * 
 * Load this file after header-cinematic.css
 */

/* ============================================
   DESTINATION PREVIEW MEGA MENU
   ============================================ */
.destination-preview-menu {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  min-width: 700px;
  padding: 24px;
}

@media (max-width: 768px) {
  .destination-preview-menu {
    grid-template-columns: 1fr;
    min-width: auto;
  }
  
  .destination-preview-image {
    display: none;
  }
}

/* Destinations List */
.destinations-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 320px;
}

/* Destination Item */
.destination-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: 
    background 150ms ease,
    transform 150ms ease;
}

.destination-item:hover,
.destination-item.active {
  background: rgba(var(--color-primary-rgb, 37, 99, 235), 0.08);
  transform: translateX(4px);
}

/* Destination Icon */
.destination-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}

.destination-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.destination-item:hover .destination-icon img {
  transform: scale(1.1);
}

/* Destination Info */
.destination-info {
  flex: 1;
  min-width: 0;
}

.destination-info h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-primary, #1e293b);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.destination-info p {
  font-size: 0.8125rem;
  color: var(--color-text-muted, #6b7280);
  margin: 0;
  line-height: 1.4;
}

/* Preview Image Panel */
.destination-preview-image {
  width: 280px;
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}

.destination-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms cubic-bezier(.16, 1, .3, 1);
}

.destination-item:hover .destination-preview-image img,
.destination-item.active .destination-preview-image img {
  transform: scale(1.05);
}

/* Preview Overlay */
.preview-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  color: white;
}

.preview-overlay h5 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 2px;
}

.preview-overlay span {
  font-size: 0.75rem;
  opacity: 0.85;
}

/* View All Link */
.view-all-destinations {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  margin-top: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary, #2563eb);
  text-decoration: none;
  border-radius: 10px;
  background: rgba(var(--color-primary-rgb, 37, 99, 235), 0.05);
  transition: 
    background 150ms ease,
    transform 150ms ease;
}

.view-all-destinations:hover {
  background: rgba(var(--color-primary-rgb, 37, 99, 235), 0.1);
  transform: translateX(4px);
}

.view-all-destinations svg {
  width: 16px;
  height: 16px;
  transition: transform 150ms ease;
}

.view-all-destinations:hover svg {
  transform: translateX(4px);
}


/* ============================================
   INTERACTIVE GLOBE MEGA MENU
   ============================================ */
.mega-menu-globe {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  min-width: 700px;
  padding: 24px;
}

@media (max-width: 768px) {
  .mega-menu-globe {
    grid-template-columns: 1fr;
    min-width: auto;
  }
  
  .globe-container {
    display: none;
  }
}

/* Globe Container */
.globe-container {
  width: 280px;
  height: 280px;
  position: relative;
  flex-shrink: 0;
}

/* 3D Globe */
.Exploria-globe {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 
    inset -25px -25px 40px rgba(0, 0, 0, 0.5),
    inset 10px 10px 20px rgba(255, 255, 255, 0.1),
    0 0 50px rgba(37, 99, 235, 0.3);
  animation: globe-rotate 30s linear infinite;
}

@keyframes globe-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Globe Lines */
.globe-lines {
  position: absolute;
  inset: 0;
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 18px,
      rgba(255, 255, 255, 0.03) 18px,
      rgba(255, 255, 255, 0.03) 19px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 18px,
      rgba(255, 255, 255, 0.03) 18px,
      rgba(255, 255, 255, 0.03) 19px
    );
  border-radius: 50%;
  animation: globe-lines-counter 30s linear infinite;
}

@keyframes globe-lines-counter {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

/* Globe Shimmer Effect */
.Exploria-globe::before {
  content: '';
  position: absolute;
  top: 5%;
  left: 5%;
  width: 40%;
  height: 30%;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.2) 0%,
    transparent 60%
  );
  border-radius: 50%;
  filter: blur(8px);
}

/* Globe Marker */
.globe-marker {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--color-accent, #f59e0b);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 
    0 0 10px var(--color-accent, #f59e0b),
    0 0 20px rgba(245, 158, 11, 0.3);
  cursor: pointer;
  transition: 
    transform 150ms ease,
    box-shadow 150ms ease;
  z-index: 5;
}

/* Marker Pulse */
.globe-marker::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-accent, #f59e0b);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.5;
  animation: marker-pulse 2s ease-out infinite;
}

@keyframes marker-pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

.globe-marker:hover {
  transform: translate(-50%, -50%) scale(1.5);
  box-shadow: 
    0 0 20px var(--color-accent, #f59e0b),
    0 0 30px rgba(245, 158, 11, 0.5);
}

/* Marker Tooltip */
.globe-marker-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: 
    opacity 150ms ease,
    transform 150ms ease,
    visibility 150ms;
  pointer-events: none;
  z-index: 10;
}

/* Tooltip Arrow */
.globe-marker-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(15, 23, 42, 0.95);
}

.globe-marker:hover .globe-marker-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Globe Destinations List */
.globe-destinations {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
}

/* Globe Destination Item */
.globe-destination-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: 
    background 150ms ease,
    transform 150ms ease;
}

.globe-destination-item:hover {
  background: rgba(var(--color-primary-rgb, 37, 99, 235), 0.08);
  transform: translateX(4px);
}

.globe-destination-item .flag {
  font-size: 1.25rem;
  width: 28px;
  text-align: center;
}

.globe-destination-item span:last-child {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary, #1e293b);
}


/* ============================================
   MULTI-COLUMN MEGA MENU
   ============================================ */
.mega-menu--full-width {
  width: calc(100vw - 80px);
  max-width: var(--header-max-width, 1180px);
  padding: 24px;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .mega-menu-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .mega-menu-grid {
    grid-template-columns: 1fr;
  }
}

/* Mega Menu Column */
.mega-menu-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Mega Menu Heading */
.mega-menu-heading {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted, #6b7280);
  padding: 0 0 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
}

/* Menu Icon */
.menu-icon {
  font-size: 1rem;
  width: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* CTA Column */
.mega-menu-cta {
  background: linear-gradient(
    135deg,
    rgba(var(--color-primary-rgb, 37, 99, 235), 0.05) 0%,
    rgba(var(--color-accent-rgb, 245, 158, 11), 0.05) 100%
  );
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}

.dark-mode .mega-menu-cta {
  background: linear-gradient(
    135deg,
    rgba(var(--color-primary-rgb, 37, 99, 235), 0.15) 0%,
    rgba(var(--color-accent-rgb, 245, 158, 11), 0.15) 100%
  );
}

/* CTA Image */
.mega-menu-cta-image {
  width: 100%;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}

.mega-menu-cta-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms cubic-bezier(.16, 1, .3, 1);
}

.mega-menu-cta:hover .mega-menu-cta-image img {
  transform: scale(1.05);
}

/* CTA Text */
.mega-menu-cta h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-primary, #1e293b);
  margin: 0 0 4px;
}

.mega-menu-cta p {
  font-size: 0.8125rem;
  color: var(--color-text-muted, #6b7280);
  margin: 0 0 14px;
  line-height: 1.4;
}

/* CTA Button */
.mega-menu-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--color-primary, #2563eb) 0%, var(--color-primary-dark, #1d4ed8) 100%);
  border-radius: 10px;
  text-decoration: none;
  transition: 
    transform 150ms ease,
    box-shadow 150ms ease;
}

.mega-menu-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(var(--color-primary-rgb, 37, 99, 235), 0.4);
}


/* ============================================
   SUB MENU ENHANCEMENTS
   ============================================ */
.sub-menu {
  min-width: 220px;
}

.sub-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 0.875rem;
  color: var(--color-text-secondary, #374151);
  text-decoration: none;
  transition: 
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.sub-menu li a:hover {
  background: rgba(var(--color-primary-rgb, 37, 99, 235), 0.08);
  color: var(--color-primary, #2563eb);
  transform: translateX(4px);
}

/* Nested Submenu */
.sub-menu .sub-menu {
  position: absolute;
  left: 100%;
  top: 0;
  margin-left: 8px;
}

.sub-menu li.menu-item-has-children > a::after {
  content: '';
  margin-left: auto;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}


/* ============================================
   VIEW ALL LINKS
   ============================================ */
.view-all-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  margin-top: 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary, #2563eb);
  text-decoration: none;
  border-radius: 10px;
  background: rgba(var(--color-primary-rgb, 37, 99, 235), 0.05);
  transition: 
    background 150ms ease,
    transform 150ms ease;
}

.view-all-link:hover {
  background: rgba(var(--color-primary-rgb, 37, 99, 235), 0.1);
  transform: translateY(-2px);
}


/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .Exploria-globe,
  .globe-lines {
    animation: none;
  }
  
  .globe-marker::before {
    animation: none;
  }
  
  .destination-item,
  .globe-destination-item,
  .mega-menu-cta-btn,
  .view-all-destinations,
  .view-all-link {
    transition: none;
  }
}
