@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

/* -------------------- ESTILO GENERAL -------------------- */
body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  background: radial-gradient(circle at 50% 20%, #faf8ff, #f5f2ff, #ebe5ff);
  color: #2b003f;
  padding-bottom: 90px;
  transition: background 0.8s ease, color 0.8s ease;
  overflow-x: hidden;
}

/* -------------------- MODO OSCURO (CEM CINEMÁTICO) -------------------- */
body.dark-mode {
  background: radial-gradient(circle at 50% 20%, #0b0013, #10001f, #1a002b);
  color: #f5f5f5;
}

/* -------------------- HEADER CEM -------------------- */
.cem-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 0, 150, 0.2);
  box-shadow: 0 0 25px rgba(200, 100, 255, 0.25);
  position: sticky;
  top: 0;
  z-index: 999;
}

body.dark-mode .cem-header {
  background: rgba(20, 0, 40, 0.9);
  box-shadow: 0 0 25px rgba(255, 0, 150, 0.25);
}

.cem-logo {
  display: flex;
  gap: 0.1em;
  align-items: center;
}

.cem-nav {
  justify-content: center;
    flex-direction: row;
    gap: 15px;
    flex: unset;
}

.btn-header {
  padding: 10px 22px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(255, 0, 150, 0.4);
  background: linear-gradient(135deg, #ff0080, #7928ca);
  box-shadow: 0 0 15px rgba(255, 0, 150, 0.4);
  transition: all 0.3s ease;
}

.btn-header:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(255, 0, 150, 0.6);
}

/* -------------------- BUSCADOR -------------------- */
.search-container {
  font-family: 'Poppins', sans-serif;
  text-align: center;
  margin: 30px 0 10px;
}

.search-container input[type="text"] {
  font-family: 'Poppins', sans-serif;
  width: 80%;
  max-width: 500px;
  padding: 12px 20px;
  font-size: 16px;
  border-radius: 25px;
  border: 2px solid rgba(255, 0, 150, 0.3);
  background: rgba(255, 255, 255, 0.8);
  color: #2b003f;
  outline: none;
  transition: all 0.4s ease;
  box-shadow: 0 0 12px rgba(255, 0, 150, 0.15);
}

.search-container input[type="text"]:focus {
  border-color: #ff0080;
  box-shadow: 0 0 22px rgba(255, 0, 150, 0.4);
}

body.dark-mode .search-container input[type="text"] {
  background: rgba(30, 0, 60, 0.6);
  color: #fff;
}

/* -------------------- BOTONES DE FILTRO -------------------- */
.filter-buttons {
  text-align: center;
  margin: 20px 0 10px;
}

.filter-buttons button {
  font-family: 'Montserrat', sans-serif;
  margin: 10px 6px;
  padding: 9px 22px;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 0, 150, 0.25);
  color: #2b003f;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-buttons button:hover {
  background: linear-gradient(135deg, #ff0080, #7928ca);
  box-shadow: 0 0 20px rgba(255, 0, 150, 0.5);
  color: #fff;
}

body.dark-mode .filter-buttons button {
  background: rgba(40, 0, 80, 0.6);
  color: #fff;
}

/* -------------------- GRID DE CLASES -------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 35px;
  padding: 40px;
  max-width: 1400px;
  margin: auto;
  animation: fadeIn 1s ease;
}

@keyframes fadeIn {
  from { opacity: 0; filter: blur(10px); transform: translateY(20px); }
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

/* -------------------- TARJETAS -------------------- */
.card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(150, 100, 255, 0.2);
  transition: transform 0.6s ease, box-shadow 0.6s ease;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.card:hover {
  transform: scale(1.05) rotateX(3deg) rotateY(-3deg);
  box-shadow: 0 25px 50px rgba(255, 0, 150, 0.4);
}

body.dark-mode .card {
  background: #0a0015;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

/* Miniatura */
.thumbnail-container {
  position: relative;
  overflow: hidden;
  display: block;
}

.thumbnail {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s ease, filter 0.6s ease;
  border-radius: 16px;
  filter: brightness(95%) contrast(1.05);
}

.card:hover .thumbnail {
  transform: scale(1.1);
  filter: brightness(80%);
}

/* Overlay con Play */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255,0,150,0.15), rgba(0,0,0,0.4));
  opacity: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}

.card:hover .overlay {
  opacity: 1;
}

/* Ícono Play */
.play-icon {
  color: #fff;
  font-size: 3.5em;
  background: radial-gradient(circle at center, rgba(255,0,100,0.8), rgba(255,0,150,0.4));
  border-radius: 50%;
  padding: 20px;
  box-shadow: 0 0 25px rgba(255,0,150,0.6);
  animation: playPulse 2.3s infinite ease-in-out;
}

@keyframes playPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 25px rgba(255,0,150,0.4); }
  50% { transform: scale(1.15); box-shadow: 0 0 45px rgba(255,0,150,0.8); }
}

/* Contenido inferior */
.card-content {
  background: linear-gradient(180deg, #f7f5ff, #ece9ff);
  padding: 18px;
  text-align: center;
  border-top: 1px solid rgba(255,0,150,0.3);
}

.card-content h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #7900b5;
  margin: 4px 0 10px;
}

.card-content h5 {
  font-size: 1.05rem;
  font-weight: 400;
  color: #555;
  margin: 0 0 10px;
}

.card-content p {
  font-size: 14px;
  color: #4a004cb3;
  margin-top: -10px;
  margin-bottom: -5px;
}

body.dark-mode .card-content {
  background: linear-gradient(180deg, rgba(20,0,40,0.95), rgba(10,0,25,0.95));
  color: #cfcfcf;
}

/* -------------------- PANEL INFERIOR -------------------- */
.app-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.9), rgba(240,230,255,0.9));
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid rgba(255,0,150,0.3);
  box-shadow: 0 -5px 30px rgba(150,0,200,0.2);
  z-index: 1000;
}

body.dark-mode .app-panel {
  background: linear-gradient(90deg, rgba(20,0,40,1), rgba(10,0,25,1));
  box-shadow: 0 -5px 30px rgba(255,0,150,0.3);
}

.app-button {
  font-family: 'Montserrat', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  color: #2b003f;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.3s ease;
}

.app-button:hover {
  transform: scale(1.15);
  color: #ff79e0;
}

body.dark-mode .app-button {
  color: #fff;
}

/* -------------------- SWITCH DARK MODE -------------------- */
/* -------------------- SWITCH ESTILO DÍA/NOCHE -------------------- */
.switch {
  font-size: 17px;
  position: relative;
  display: inline-block;
  width: 4em;
  height: 2.2em;
  border-radius: 30px;
  box-shadow: 0 0 10px rgba(255, 0, 150, 0.3);
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #2a2a2a;
  transition: 0.4s;
  border-radius: 30px;
  overflow: hidden;
}

.slider:before {
  position: absolute;
  content: "";
  height: 1.2em;
  width: 1.2em;
  border-radius: 20px;
  left: 0.5em;
  bottom: 0.5em;
  transition: 0.4s cubic-bezier(0.81, -0.04, 0.38, 1.5);
  box-shadow: inset 8px -4px 0px 0px #fff;
}

.switch input:checked + .slider {
  background-color: #00a6ff;
}

.switch input:checked + .slider:before {
  transform: translateX(1.8em);
  box-shadow: inset 15px -4px 0px 15px #ffcf48;
}

/* Estrellas y nube */
.star {
  background-color: #fff;
  border-radius: 50%;
  position: absolute;
  width: 5px;
  height: 5px;
  transition: all 0.4s;
}

.star_1 { left: 2.5em; top: 0.5em; }
.star_2 { left: 2.2em; top: 1.2em; }
.star_3 { left: 3em;   top: 0.9em; }

.switch input:checked ~ .slider .star {
  opacity: 0;
}

.cloud {
  width: 3.5em;
  position: absolute;
  bottom: -1.4em;
  left: -1.1em;
  opacity: 0;
  transition: all 0.4s;
}

.switch input:checked ~ .slider .cloud {
  opacity: 1;
}


/* -------------------- RESPONSIVO -------------------- */
@media (max-width: 768px) {
  .cem-header { flex-direction: column; text-align: center; }
  .cem-nav { margin-top: 10px; }
  .grid { padding: 20px; gap: 20px; }
  .card, .card:hover { transform: none !important; }
}

.icon-sun, .icon-moon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.1em;
  color: #fff;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.icon-moon {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-30deg);
}

.switch input:checked + .slider .icon-sun {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(30deg);
}

.switch input:checked + .slider .icon-moon {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg);
}
