* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #64748b;
  --background: #f8fafc;
  --surface: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --shadow: rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --transition: all 0.3s ease;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Dark Mode */
body.dark {
  --background: #0f172a;
  --surface: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #334155;
  --shadow: rgba(0, 0, 0, 0.3);
}

/* Layout */
.container {
  display: flex;
  justify-content: center;
  padding: 2rem;
  min-height: calc(100vh - 100px);
}

.main-content {
  width: 100%;
  max-width: 900px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 3rem;
  box-shadow: 0 4px 6px -1px var(--shadow);
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 3rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

/* Form Styling */
.search-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Platform Toggle */
.platform-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.platform-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
}

.platform-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.platform-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.platform-btn svg {
  width: 20px;
  height: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  display: block;
  opacity: 0.8;
  line-height: 1.4;
}

textarea,
input[type="text"],
input[type="date"] {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: var(--transition);
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
}

textarea:focus,
input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.date-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Button Styling */
.search-button {
  position: relative;
  width: 100%;
  padding: 1rem;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}

.search-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.3);
}

.search-button:active {
  transform: translateY(0);
}

/* Rate Limit Info */
.rate-limit-info {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.rate-limit-info.warning {
  color: #f59e0b;
}

.rate-limit-info.error {
  color: #ef4444;
}

/* Loading State */
.loading {
  display: none;
  text-align: center;
  padding: 3rem;
}

.spinner {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Results Carousel */
.results-carousel {
  display: none;
  margin-top: 2rem;
}

#results-count {
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.carousel-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

.carousel-track {
  display: flex;
  gap: 1.25rem;
  transition: transform 0.4s ease-out;
  padding: 0.5rem;
}

.video-card {
  flex: 0 0 320px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px var(--shadow);
}

.video-thumbnail {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
/* Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: var(--bg);
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideUp 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--hover);
  color: var(--text);
}

.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  border-radius: 50%;
}

.modal-icon.warning {
  background: rgba(251, 191, 36, 0.1);
  color: #f59e0b;
}

.modal-icon.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.modal-icon.info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px;
  text-align: center;
}

.modal-message {
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: center;
  margin: 0 0 24px;
  white-space: pre-line;
}
:root {
  /* ...existing vars */
  --bg: var(--surface);
  --text: var(--text-primary);
  --hover: #f1f5f9;
  --accent: var(--primary);
  --accent-hover: var(--primary-hover);
}


.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-button {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: "Inter", sans-serif;
}

.modal-button.primary {
  background: var(--accent);
  color: white;
}

.modal-button.primary:hover {
  background: var(--accent-hover);
}

.modal-button.secondary {
  background: var(--hover);
  color: var(--text);
}

.modal-button.secondary:hover {
  background: var(--border);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dark mode adjustments */
body.dark .modal {
  background: #1a1a1a;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.video-info {
  padding: 1.25rem;
}

.video-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.4;
}

.video-channel {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.match-info {
  background: var(--background);
  padding: 0.875rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.match-text {
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.match-time {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
}

/* Carousel Navigation */
.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

.carousel-button:hover {
  opacity: 1;
  box-shadow: 0 4px 12px var(--shadow);
}

.carousel-button.prev {
  left: 1rem;
}
.carousel-button.next {
  right: 1rem;
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  z-index: 100;
  font-size: 1.5rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  box-shadow: 0 4px 12px var(--shadow);
  transform: scale(1.1);
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 0;
}

.kofi-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ff5e5b;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.kofi-button:hover {
  background: #ff4543;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(255, 94, 91, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .main-content {
    padding: 2rem 1.5rem;
  }

  h1 {
    font-size: 2rem;
  }

  .date-range {
    grid-template-columns: 1fr;
  }

  .video-card {
    flex: 0 0 280px;
  }

  .carousel-button {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }

  .theme-toggle {
    top: 1rem;
    right: 1rem;
  }

  .platform-btn {
    font-size: 0.875rem;
    padding: 0.75rem;
  }

  .platform-btn svg {
    width: 16px;
    height: 16px;
  }

  .autocomplete-dropdown {
    max-height: 200px;
  }

  .autocomplete-item {
    padding: 0.5rem 0.75rem;
  }

  .autocomplete-item img {
    width: 32px;
    height: 45px;
  }
}
