/*
Theme Name: Clip Video
Theme URI: https://clip.video
Author: Clip Video
Description: Tema tipo TikTok/Reels para videos.
Version: 1.0
License: GPL v2 or later
Text Domain: clip-video
*/

/* Reset y base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.reels-container {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.reel {
  height: 100vh;
  position: relative;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* Fondo animado */
.reel-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(270deg, #0A2B4E, #001f3f, #0A2B4E);
  background-size: 400% 400%;
  animation: moveBg 12s infinite;
  z-index: 1;
}

@keyframes moveBg {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Área de descripción (lyrics scroll) */
.lyrics-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: clamp(240px, 34vh, 420px);
  overflow: hidden;
  z-index: 2;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lyrics-wrapper::before,
.lyrics-wrapper::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 54px;
  z-index: 3;
  pointer-events: none;
}
.lyrics-wrapper::before {
  top: 0;
  background: linear-gradient(to bottom, #000 0%, rgba(0,0,0,0) 100%);
}
.lyrics-wrapper::after {
  bottom: 0;
  background: linear-gradient(to top, #000 0%, rgba(0,0,0,0) 100%);
}

.lyrics {
  position: absolute;
  width: min(92vw, 760px);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: #fff;
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 0.2px;
  animation: scrollText linear infinite;
  will-change: transform;
}

@keyframes scrollText {
  0% { transform: translateX(-50%) translateY(100%); }
  100% { transform: translateX(-50%) translateY(-110%); }
}

/* Información del video */
.video-info {
  position: absolute;
  left: 20px;
  right: 80px;
  bottom: 92px;
  z-index: 3;
  color: #fff;
}

.video-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 5px;
  line-height: 1.2;
}

.video-author {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 4px;
}

.video-meta {
  font-size: 14px;
  margin-top: 4px;
  opacity: 0.95;
}

/* Acciones laterales */
.actions {
  position: absolute;
  right: 10px;
  bottom: 116px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: #fff;
  text-align: center;
  user-select: none;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.action-btn:active {
  transform: scale(0.95);
}
.action-btn span:first-child {
  font-size: 28px;
}
.action-count {
  font-size: 12px;
  opacity: 0.9;
}

/* Loading */
.loading-indicator {
  text-align: center;
  padding: 20px;
  color: #fff;
  background: rgba(0,0,0,0.5);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 480px) {
  .lyrics-wrapper {
    top: 0;
    height: clamp(250px, 38vh, 430px);
  }
  .lyrics {
    font-size: 16px;
    line-height: 1.75;
  }
  .video-info {
    bottom: 98px;
    right: 72px;
  }
  .video-title {
    font-size: 19px;
  }
}

/* Botón flotante de filtros */
.filter-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #00E5FF;
    color: #000;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.1s ease;
}
.filter-toggle:active {
    transform: scale(0.95);
}

/* Overlay de filtros */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}
.filter-overlay.active {
    display: flex;
}
.filter-container {
    background: #1e1e2f;
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 20px 35px rgba(0,0,0,0.3);
}
.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
}
.filter-header h3 {
    margin: 0;
    font-size: 1.2rem;
}
.close-filter {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
}
.filter-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.filter-group label {
    font-size: 0.85rem;
    opacity: 0.8;
}
.filter-group select {
    background: #2a2a3a;
    border: 1px solid #444;
    border-radius: 12px;
    padding: 10px 12px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
}
.filter-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #333;
}
.apply-filters-btn, .reset-filters-btn {
    flex: 1;
    padding: 10px;
    border-radius: 40px;
    border: none;
    font-weight: bold;
    cursor: pointer;
}
.apply-filters-btn {
    background: #00E5FF;
    color: #000;
}
.reset-filters-btn {
    background: #3a3a4a;
    color: #fff;
}

/* Menú móvil inferior */
.mobile-menu {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 24px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    padding: 10px 24px;
    border-radius: 60px;
    z-index: 15;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.menu-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
}
.menu-btn:hover,
.menu-btn:active {
    opacity: 1;
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.15);
}
.menu-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
}

/* Video player */
.reel-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    background: #000;
}
.reel.has-video .reel-bg {
    display: none;
}
.reel.has-video .lyrics-wrapper {
    display: none;
}