:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle at 8% 10%, rgba(237, 38, 48, 0.08), transparent 35%),
    radial-gradient(circle at 90% 0%, rgba(237, 38, 48, 0.05), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(237, 38, 48, 0.04), transparent 50%),
    linear-gradient(180deg, #0a0a0a 0%, #0d0d0d 50%, #0a0a0a 100%);
}

#cardsGrid:empty {
  margin-top: 0;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modal-panel {
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), opacity 220ms ease;
}

#videoModal.is-open .modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #ed2630;
  outline-offset: 2px;
}

/* Dark-themed select options */
select option {
  background-color: #111111;
  color: #e2e8f0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #ed2630;
}

/* Responsive mobile adjustments (375px) */
@media (max-width: 640px) {
  #viewTabs {
    width: 100%;
    display: flex;
    justify-content: stretch;
  }

  #viewTabs .view-tab {
    flex: 1;
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    font-size: 0.75rem;
  }

  .video-card .save-video-btn {
    opacity: 1; /* Always visible on mobile */
  }

  #modalNavToolbar {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Controles cómodos y reproductor contenido en pantallas pequeñas. */
body.modal-open { overflow: hidden; }
#modalBody { min-height: 0; overflow-wrap: anywhere; overscroll-behavior: contain; }
#videoModal .modal-panel { max-height: calc(100dvh - 2rem); }
#modalTitle { white-space: normal; overflow-wrap: anywhere; }
#videoModal button, .save-video-btn { min-width: 44px; min-height: 44px; }
#activeFiltersBar > span { max-width: 100%; overflow-wrap: anywhere; }
#activeFiltersBar button { min-width: 44px; min-height: 44px; flex-shrink: 0; }
@media (max-width: 640px) {
  #viewTabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #viewTabs .view-tab { min-width: 0; min-height: 48px; flex-wrap: wrap; gap: 4px; padding: 8px 4px; }
  #viewTabs .material-symbols-outlined { display: none; }
  #filtersForm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #filtersForm > label:first-child { grid-column: 1 / -1; }
  #filtersForm input, #filtersForm select { min-width: 0; min-height: 44px; font-size: 16px; }
  #modalPosition { display: none; }
  #modalBody { padding: 12px; }
  #modalNavToolbar { gap: 6px; }
  #modalNavToolbar button { padding-left: 8px; padding-right: 8px; }
}
