/**
 * Topbar - E-Visa Sri Lanka
 * Design moderne avec images décoratives
 */

/* ===================================
   TOPBAR CONTAINER
   ================================== */

.topbar {
  position: relative;
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--primary) 50%,
    var(--primary-dark) 100%
  );
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  z-index: 100;
}

/* Effet de glassmorphism subtil */
.topbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  pointer-events: none;
  z-index: 1;
}

/* ===================================
   TOPBAR CONTENT
   ================================== */

.topbar-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  padding: 1rem 2rem;
  z-index: 2;
}

/* ===================================
   BRAND (Logo + Title)
   ================================== */

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: white;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 10;
}

.topbar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.5rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.topbar-brand:hover .topbar-logo {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.topbar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.topbar-title-main {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  line-height: 1;
}

.topbar-title-sub {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary-pale);
  letter-spacing: 1px;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

/* ===================================
   IMAGES DÉCORATIVES
   ================================== */

.topbar-images {
  display: flex;
  gap: 1rem;
  align-items: center;
  position: relative;
  z-index: 5;
}

.topbar-image {
  position: relative;
  width: 120px;
  height: 80px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.topbar-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              filter 0.4s ease;
  filter: brightness(0.9) contrast(1.1);
}

/* Overlay avec gradient coloré */
.topbar-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 88, 187, 0.3) 0%,
    rgba(238, 157, 30, 0.2) 100%
  );
  mix-blend-mode: overlay;
  opacity: 0.7;
  transition: opacity 0.4s ease, background 0.4s ease;
  pointer-events: none;
}

/* Effets au hover */
.topbar-image:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.topbar-image:hover img {
  transform: scale(1.1);
  filter: brightness(1) contrast(1.2);
}

.topbar-image:hover .topbar-image-overlay {
  opacity: 0.5;
  background: linear-gradient(
    135deg,
    rgba(0, 88, 187, 0.2) 0%,
    rgba(238, 157, 30, 0.3) 100%
  );
}

/* Image 1 : Forme pentagonale moderne */
.topbar-image-1 {
    clip-path: polygon(
        25% 0%,
        75% 0%,
        100% 50%,
        75% 100%,
        25% 100%,
        0% 50%
    );
}

/* Image 2 : Forme hexagonale */
.topbar-image-2 {
  clip-path: polygon(
    25% 0%,
    75% 0%,
    100% 50%,
    75% 100%,
    25% 100%,
    0% 50%
  );
}

/* Effet de bordure lumineuse au hover */
.topbar-image::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    135deg,
    var(--secondary) 0%,
    var(--primary) 50%,
    var(--secondary) 100%
  );
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
}

.topbar-image:hover::before {
  opacity: 0.6;
}

/* ===================================
   ANIMATIONS
   ================================== */

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Animation d'apparition au chargement */
@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.topbar-image-1 {
  animation: slideInFromRight 0.6s ease-out 0.2s both;
}

.topbar-image-2 {
  animation: slideInFromRight 0.6s ease-out 0.4s both;
}

/* ===================================
   RESPONSIVE
   ================================== */

/* Tablette et plus petit */
@media (max-width: 1024px) {
  .topbar-content {
    padding: 1rem 1.5rem;
  }

  .topbar-image {
    width: 100px;
    height: 70px;
  }

  .topbar-title-main {
    font-size: 1.25rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .topbar-content {
    padding: 0.75rem 1rem;
    min-height: 70px;
  }

  .topbar-logo {
    width: 50px;
    height: 50px;
  }

  .topbar-title-main {
    font-size: 1rem;
  }

  .topbar-title-sub {
    font-size: 0.75rem;
  }

  /* Images plus petites sur mobile */
  .topbar-image {
    width: 80px;
    height: 60px;
  }

  .topbar-images {
    gap: 0.5rem;
  }
}

/* Très petit mobile */
@media (max-width: 480px) {
  .topbar-content {
    padding: 0.5rem;
    min-height: 60px;
  }

  .topbar-brand {
    gap: 0.5rem;
  }

  .topbar-logo {
    width: 40px;
    height: 40px;
  }

  .topbar-title-main {
    font-size: 0.875rem;
  }

  .topbar-title-sub {
    font-size: 0.625rem;
  }

  /* Masquer une image sur très petit écran */
  .topbar-image-2 {
    display: none;
  }

  .topbar-image {
    width: 70px;
    height: 50px;
  }
}

/* ===================================
   DARK MODE (si activé)
   ================================== */

.dark .topbar {
  background: linear-gradient(
    135deg,
    rgba(0, 46, 98, 0.95) 0%,
    rgba(0, 88, 187, 0.9) 50%,
    rgba(0, 46, 98, 0.95) 100%
  );
}

.dark .topbar-logo {
  background: rgba(255, 255, 255, 0.15);
}

.dark .topbar-image-overlay {
  opacity: 0.8;
}

/* ===================================
   EFFETS SUPPLÉMENTAIRES
   ================================== */

/* Effet de brillance qui passe sur les images */
@keyframes shine {
  0% {
    left: -100%;
  }
  100% {
    left: 200%;
  }
}

.topbar-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: skewX(-25deg);
}

.topbar-image:hover::after {
  animation: shine 1s ease-in-out;
}

/* Couleur globale pour tous les éléments du header */
body > header * {
  color: white;
}

/* ===================================
   LANGUAGE SWITCHER
   ================================== */

.topbar-lang {
  position: relative;
  z-index: 20;
  margin-right: 1rem;
}

.topbar-lang-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.topbar-lang-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.topbar-lang-current {
  font-weight: 600;
}

.topbar-lang-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 160px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 100;
}

.topbar-lang-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.topbar-lang-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #333;
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.topbar-lang-option:hover {
  background: #f5f5f5;
  color: var(--primary);
}

.topbar-lang-option.active {
  background: var(--primary);
  color: white;
}

.topbar-lang-option .flag-icon {
  flex-shrink: 0;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .topbar-lang {
    margin-right: 0.5rem;
  }

  .topbar-lang-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
  }

  .topbar-lang-btn .fa-globe {
    display: none;
  }
}

@media (max-width: 480px) {
  .topbar-lang-btn {
    padding: 0.35rem 0.5rem;
  }

  .topbar-lang-btn .fa-chevron-down {
    display: none;
  }
}
