/* Category Marquee Styles */
.category-marquee-wrapper {
  position: relative;
  margin: 2rem 0;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 2rem;
}

.marquee-header {
  text-align: center;
  margin-bottom: 2rem;
  color: white;
}

.marquee-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.marquee-icon {
  font-size: 1.5rem;
  animation: pulse 2s infinite;
}

.marquee-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin: 0;
}

.marquee-container {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.marquee-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.marquee-track {
  display: flex;
  gap: 2rem;
  padding: 0.5rem;
  min-width: max-content;
}

.marquee-item {
  flex-shrink: 0;
  width: 320px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  /* Ensure consistent height */
  height: 160px;
  position: relative;
  z-index: 3;
}

.marquee-item:hover {
  transform: translateY(-3px);
}

.item-card {
  background: white;
  border-radius: 15px;
  padding: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: none !important;
  /* Ensure consistent height */
  height: 100%;
  display: flex;
  flex-direction: column;
}

.item-card:hover {
  border-color: #667eea;
  transform: scale(1.02);
  background-color: #f8f9ff;
}

.category-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.3rem 0.6rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 25px;
  font-size: 0.8rem;
  font-weight: 600;
  width: fit-content;
  flex-shrink: 0;
}

.category-name {
  font-weight: 600;
  color: white;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.site-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-height: 0;
}

.site-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-height: 0;
}

.site-name {
  font-weight: 600;
  color: #333;
  font-size: 1rem;
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Ensure consistent height for title area */
  min-height: 2.6em;
  max-height: 2.6em;
}

.site-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #666;
  flex-shrink: 0;
  margin-top: auto;
}

.vote-count {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #667eea;
  font-weight: 600;
}

.vote-icon {
  font-size: 0.7rem;
}

.premium-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #333;
  padding: 0.2rem 0.4rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.premium-icon {
  margin-right: 0.2rem;
}

.item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 15px;
}

.item-card:hover .item-overlay {
  opacity: 1;
}

.visit-text {
  color: white;
  font-weight: 600;
  font-size: 1rem;
}

.arrow-icon {
  margin-left: 0.5rem;
  transition: transform 0.3s ease;
}

.item-card:hover .arrow-icon {
  transform: translateX(3px);
}

/* Navigation Arrow Buttons */
.marquee-nav-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  pointer-events: none;
}

.marquee-nav-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #667eea;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  pointer-events: auto;
}

.marquee-nav-button:hover {
  background: white;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.marquee-nav-button:active {
  transform: scale(0.95);
}

.marquee-nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.marquee-nav-button:disabled:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.marquee-gradient-left,
.marquee-gradient-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  pointer-events: none;
  z-index: 1;
}

.marquee-gradient-left {
  left: 0;
  background: linear-gradient(to right, rgba(102, 126, 234, 0.25) 0%, rgba(102, 126, 234, 0) 50%);
}

.marquee-gradient-right {
  right: 0;
  background: linear-gradient(to left, rgba(102, 126, 234, 0.25) 0%, rgba(102, 126, 234, 0) 50%);
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* iPad and tablet specific styles */
@media (max-width: 1024px) {
  .marquee-container {
    /* Improve touch scrolling on iPads */
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  .marquee-item {
    scroll-snap-align: start;
  }

  /* Disable hover effects on touch devices */
  .marquee-item:hover {
    transform: none;
  }

  .item-card:hover {
    transform: none;
    background-color: white;
    border-color: rgba(0, 0, 0, 0.1);
  }

  .item-card:hover .item-overlay {
    opacity: 0;
  }

  .item-card:hover .arrow-icon {
    transform: none;
  }

  /* Adjust nav buttons for tablets */
  .marquee-nav-button {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }

  .marquee-nav-buttons {
    margin-top: 1.25rem;
    gap: 0.75rem;
  }
}

@media (max-width: 768px) {
  .category-marquee-wrapper {
    padding: 1.5rem;
    margin: 1rem 0;
  }

  .marquee-title {
    font-size: 1.5rem;
  }

  .marquee-subtitle {
    font-size: 1rem;
  }

  .marquee-item {
    width: 280px;
    height: 140px;
  }

  .item-card {
    padding: 0.8rem;
  }

  .category-badge {
    font-size: 0.7rem;
  }

  .site-name {
    font-size: 0.9rem;
    min-height: 2.4em;
    max-height: 2.4em;
  }

  .marquee-gradient-left,
  .marquee-gradient-right {
    width: 30px;
  }

  /* Smaller nav buttons for mobile */
  .marquee-nav-button {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .marquee-nav-buttons {
    margin-top: 1rem;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .category-marquee-wrapper {
    padding: 1rem;
  }

  .marquee-title {
    font-size: 1.3rem;
  }

  .marquee-item {
    width: 250px;
    height: 130px;
  }

  .item-card {
    padding: 0.6rem;
  }

  .category-name {
    font-size: 0.8rem;
  }

  .site-name {
    font-size: 0.85rem;
    min-height: 2.2em;
    max-height: 2.2em;
  }

  /* Even smaller nav buttons for small mobile */
  .marquee-nav-button {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .marquee-nav-buttons {
    margin-top: 0.75rem;
    gap: 0.5rem;
  }
}

.marquee-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: white;
  font-size: 1.1rem;
  gap: 1rem;
}

.marquee-loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.marquee-empty {
  text-align: center;
  padding: 3rem;
  color: white;
}

.marquee-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.marquee-empty-text {
  font-size: 1.1rem;
  opacity: 0.9;
}