/* Scrolling Flags Section Styles with flag-icons integration */
.flags-section {
  width: 100%;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.8), rgba(0, 77, 0, 0.2), rgba(0, 0, 0, 0.8));
  padding: 30px 0;
  margin: 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(0, 77, 0, 0.3);
  border-bottom: 1px solid rgba(0, 77, 0, 0.3);
}

.flags-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
}

.flags-header {
  text-align: center;
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.flags-scroll {
  display: flex;
  align-items: center;
  width: max-content; /* Allow content to determine width */
  animation: scrollFlags 60s linear infinite;
}

.flags-scroll:hover {
  animation-play-state: paused; /* Pause on hover */
}

.flag-item {
  margin: 0 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
}

.flag-item .fi {
  width: 60px;
  height: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0, 77, 0, 0.5);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: inline-block;
  overflow: hidden;
}

.flag-item:hover .fi {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(0, 77, 0, 0.5);
  z-index: 10;
  border: 2px solid var(--color-accent-green, #00a651);
}

.flag-item::after {
  content: attr(data-country);
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background-color: rgba(0, 77, 0, 0.9);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  white-space: nowrap;
  z-index: 20;
}

.flag-item:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@keyframes scrollFlags {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%); /* Move to half of the content for seamless loop */
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .flag-item .fi {
    width: 50px;
    height: 50px;
  }
  
  .flag-item {
    margin: 0 10px;
  }
  
  .flags-section {
    padding: 20px 0;
  }
  
  .flags-header {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .flag-item .fi {
    width: 40px;
    height: 40px;
  }
  
  .flag-item {
    margin: 0 8px;
  }
  
  .flags-section {
    padding: 15px 0;
  }
  
  .flags-header {
    font-size: 0.9rem;
  }
}
