/* Reset & Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #000000;
  --secondary-color: #25f4ee;
  --accent-color: #fe2c55;
  --text-color: #333333;
  --light-bg: #f5f5f5;
  --border-color: #e0e0e0;
  --success-color: #4caf50;
  --error-color: #f44336;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #ffffff;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #1a1a1a 100%);
  color: white;
  padding: 40px 20px;
  margin-bottom: 40px;
  border-bottom: 3px solid var(--secondary-color);
  box-shadow: var(--shadow);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.tagline {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 15px;
}

.legal-disclaimer {
  font-size: 0.9rem;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 10px 15px;
  border-left: 3px solid var(--secondary-color);
  border-radius: 4px;
  display: inline-block;
}

/* Controls */
.controls {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  align-items: center;
  padding: 20px;
  background-color: var(--light-bg);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.country-selector,
.date-navigation {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.country-selector label,
.date-navigation label {
  font-weight: 600;
  color: var(--text-color);
}

select,
.date-input,
.btn-nav {
  padding: 10px 15px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

select:focus,
.date-input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(37, 244, 238, 0.1);
}

.btn-nav {
  background-color: var(--primary-color);
  color: white;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-nav:hover {
  background-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(254, 44, 85, 0.3);
}

.btn-nav:active {
  transform: translateY(0);
}

.current-date {
  font-weight: 700;
  color: var(--primary-color);
  padding: 8px 15px;
  background-color: white;
  border-radius: 20px;
  border: 2px solid var(--secondary-color);
  white-space: nowrap;
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.loading.hidden {
  display: none;
}

.spinner {
  border: 4px solid var(--light-bg);
  border-top-color: var(--secondary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading p {
  font-size: 1.1rem;
  color: var(--text-color);
}

/* Main Content */
.main-content {
  padding: 20px 0;
  min-height: 400px;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

/* Video Card */
.video-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.video-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.video-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  overflow: hidden;
  background-color: var(--light-bg);
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.video-card:hover .video-thumbnail img {
  transform: scale(1.05);
}

.video-rank {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--accent-color);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.9rem;
}

.video-info {
  padding: 15px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.video-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-color);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-author {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 12px;
}

.video-stats {
  display: flex;
  gap: 15px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: #666;
}

.stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-icon {
  font-size: 1rem;
}

.video-link {
  align-self: flex-start;
  padding: 8px 16px;
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-top: auto;
}

.video-link:hover {
  background-color: var(--accent-color);
  transform: translateX(4px);
}

/* Empty State */
.empty-state,
.error-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 1.2rem;
}

.empty-state.hidden,
.error-state.hidden {
  display: none;
}

.error-state {
  color: var(--error-color);
}

/* Footer */
.footer {
  background-color: var(--primary-color);
  color: white;
  margin-top: 80px;
  padding: 50px 20px 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto 30px;
}

.footer-section h3 {
  margin-bottom: 15px;
  font-size: 1.1rem;
  color: var(--secondary-color);
}

.footer-section p {
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 10px;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 10px;
  font-size: 0.95rem;
  opacity: 0.9;
}

.footer-section a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.footer-section a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
  .header h1 {
    font-size: 1.8rem;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .country-selector,
  .date-navigation {
    width: 100%;
    justify-content: space-between;
  }

  select,
  .date-input,
  .btn-nav {
    flex: 1;
  }

  .videos-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
  }

  .video-card {
    border-radius: 8px;
  }

  .footer-content {
    gap: 25px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.5rem;
  }

  .tagline {
    font-size: 0.95rem;
  }

  .legal-disclaimer {
    font-size: 0.8rem;
  }

  .controls {
    gap: 10px;
  }

  .btn-nav {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .videos-grid {
    grid-template-columns: 1fr;
  }

  .video-title {
    font-size: 0.9rem;
  }

  .footer-section h3 {
    font-size: 1rem;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
