/* Non-critical CSS moved from inline styles */

/* Accessibility improvements - high contrast colors */
.high-contrast-text {
  color: #1a365d;
  font-weight: 700;
}

/* Split-Flap Display Styling */
.split-flap-container {
  display: inline-flex;
  gap: 2px;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
}

.split-flap {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 48px;
  background: linear-gradient(
    180deg,
    #2a2a2a 0%,
    #1a1a1a 50%,
    #0a0a0a 50%,
    #000 100%
  );
  border: 2px solid #333;
  border-radius: 6px;
  margin: 1px;
  overflow: hidden;
  font-family: "Courier New", monospace;
  font-weight: bold;
  font-size: 24px;
  color: #ff6b35;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.3);
}

.split-flap-char {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.split-flap::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  z-index: 2;
}

.split-flap::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(
      circle at 30% 20%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 50%
    ),
    linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
  z-index: 1;
  pointer-events: none;
}

.split-flap.animate {
  animation: flipAnimation 0.6s ease-in-out;
}

@keyframes flipAnimation {
  0% {
    transform: perspective(100px) rotateX(0deg);
  }
  50% {
    transform: perspective(100px) rotateX(-90deg);
    background: linear-gradient(180deg, #333 0%, #222 50%, #111 50%, #000 100%);
  }
  100% {
    transform: perspective(100px) rotateX(0deg);
  }
}

.split-flap-decimal {
  width: 16px;
  background: none;
  border: none;
  box-shadow: none;
  color: var(--travel-green);
  font-size: 28px;
}

.split-flap-text {
  color: var(--text-color);
  font-size: 18px;
  margin-left: 8px;
  vertical-align: middle;
  font-weight: 600;
}

.passenger-number {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--travel-green);
  text-align: center;
  display: block;
}

/* Animation delays for staggered effect */
.split-flap:nth-child(1) {
  animation-delay: 0.1s;
}
.split-flap:nth-child(2) {
  animation-delay: 0.2s;
}
.split-flap:nth-child(3) {
  animation-delay: 0.3s;
}
.split-flap:nth-child(4) {
  animation-delay: 0.4s;
}
.split-flap:nth-child(5) {
  animation-delay: 0.5s;
}
.split-flap:nth-child(6) {
  animation-delay: 0.6s;
}

/* Countries list section - most CSS here except critical parts inline */
.countries-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: var(--shadow-xl);
  margin-bottom: 4rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.countries-header {
  background: linear-gradient(135deg, var(--travel-blue), var(--travel-purple));
  color: white;
  padding: 2.5rem 2rem;
  text-align: center;
  border-radius: 24px 24px 0 0;
}

.countries-header h2 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.countries-header p {
  margin: 0.5rem 0 0 0;
  font-size: 1.1rem;
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.country-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(248, 250, 255, 0.9)
  );
  backdrop-filter: blur(10px);
  border: 1px solid rgba(219, 234, 254, 0.6);
  padding: 0.8rem 1.4rem;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.3s ease;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  min-width: fit-content;
  border-radius: 28px;
  margin: 0.2rem;
}

.country-item:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 1),
    rgba(245, 248, 255, 1)
  );
  border-color: rgba(99, 179, 237, 0.8);
}

.country-item .flag {
  font-size: 1.2em;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.country-item .name {
  font-weight: 600;
  color: var(--primary-color);
}

.country-item .count {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  padding: 0.25rem 0.8rem;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 0.4rem;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
  min-width: 28px;
  text-align: center;
}

/* Mobile responsive countries */
@media (max-width: 768px) {
  .countries-grid {
    gap: 0.8rem;
    padding: 2rem 1.5rem;
  }

  .country-item {
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
    margin: 0.15rem;
  }

  .country-item .count {
    padding: 0.2rem 0.7rem;
    font-size: 0.75rem;
    margin-left: 0.3rem;
    min-width: 24px;
  }

  .countries-header {
    padding: 2rem 1.5rem;
  }

  .countries-header h2 {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .countries-grid {
    gap: 0.6rem;
    padding: 1.5rem 1rem;
  }

  .country-item {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    margin: 0.1rem;
  }

  .country-item .count {
    padding: 0.15rem 0.6rem;
    font-size: 0.7rem;
    min-width: 20px;
  }
}

/* Search results */
.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.search-result-card {
  background: white !important;
  border-radius: 12px;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  border: 2px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-result-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-color: var(--travel-blue);
}
