@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&family=Poppins:wght@300;400;600&display=swap');

/* Estilo general */
body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  background-color: #f6f6f6;
  color: #333;
  padding-bottom: 80px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode {
  background: linear-gradient(135deg, #0e0e13, #181827);
  color: #fff;
}

/* Tarjetas en modo oscuro */
body.dark-mode .block-card {
  color: #fff !important;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.15);
  filter: brightness(1.2) contrast(1.05);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Efecto de brillo animado */
body.dark-mode .block-card:hover {
  filter: brightness(1.35) contrast(1.1);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

/* Íconos en modo oscuro */
body.dark-mode .block-card i {
  color: #fff !important;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

/* Ajuste de la barra inferior */
body.dark-mode .app-panel {
  background: rgba(20, 20, 30, 0.9);
  box-shadow: 0 -2px 12px rgba(255, 255, 255, 0.1);
}

body.dark-mode .app-button {
  color: #fff;
  opacity: 0.9;
}

body.dark-mode .app-button:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* Buscador */
.search-container {
  max-width: 1200px;
  margin: 30px auto -10px;
  text-align: center;
}

.search-container input[type="text"] {
  font-family: 'Poppins', sans-serif;
  padding: 12px 20px;
  width: 80%;
  max-width: 500px;
  border-radius: 25px;
  border: 1px solid #ccc;
  font-size: 16px;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
  outline: none;
  transition: all 0.3s ease;
}

.search-container input[type="text"]:focus {
  box-shadow: 0 0 10px #aaa;
}

/* Animaciones */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* CEM SVG Animado */
.letter {
  transform: translateY(2px);
}

.inline-block {
  display: inline-block;
}

.absolute {
  position: absolute;
}

.dash {
  animation: dashArray 2s ease-in-out infinite, dashOffset 2s linear infinite;
}

@keyframes dashArray {
  0% { stroke-dasharray: 0 1 359 0; }
  50% { stroke-dasharray: 0 359 1 0; }
  100% { stroke-dasharray: 359 1 0 0; }
}

@keyframes dashOffset {
  0% { stroke-dashoffset: 365; }
  100% { stroke-dashoffset: 5; }
}

/* Header */
.cem-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background-color: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body.dark-mode .cem-header {
  background-color: #222;
  box-shadow: 0 4px 6px rgba(255, 255, 255, 0.1);
}

.cem-logo {
  display: flex;
  gap: 0.4em;
  align-items: center;
}

.cem-nav {
  display: flex;
  gap: 15px;
}

.btn-header {
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 500;
  transition: background-position 0.5s, transform 0.2s;
  border: 1px solid #ccc;
}

.btn-header:nth-child(1) {
  background: #fff;
  color: #555;
}

.btn-header:nth-child(2) {
  background: linear-gradient(90deg, #731dff, #ff0099, #fb87ff, #731dff);
  background-size: 300%;
  color: white;
  border: none;
}

.btn-header:hover {
  transform: scale(1.05);
}

.btn-header:nth-child(2):hover {
  background-position: right center;
}

/* Main grid */
.main-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  padding: 40px;
  max-width: 1200px;
  margin: auto;
}

/* --- EFECTOS GLOBALES DE HOVER --- */


@keyframes gradientFlow {
  0%   { background-position: 0% 50%; filter: brightness(1); }
  50%  { background-position: 100% 50%; filter: brightness(1.07); }
  100% { background-position: 0% 50%; filter: brightness(1); }
}

/* --- BLOQUES PRINCIPALES --- */
.block-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none; /* Quita subrayado */
  padding-top: 25px;
  padding-bottom: 10px;
  min-height: 170px;
  border-radius: 20px;
  text-align: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: #fff;
  transition: transform 0.25s ease, box-shadow 0.3s ease, filter 0.3s ease;
}

.icon-container {
  height: 60px; /* altura fija para igualar todos los iconos */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.block-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  filter: brightness(1.1);
}

.block-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: radial-gradient(circle at top left, rgba(255,255,255,0.25), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.block-card:hover::after {
  opacity: 1;
}

.block-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  opacity: 0;
  transition: opacity 0.4s ease;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.5);
}

.block-card:hover::before {
  opacity: 1;
  filter: blur(12px);
}

.block-card i {
  font-size: 2.8rem;
  transition: transform 0.4s ease;
  color: rgba(255, 255, 255, 0.92);
  pointer-events: none; /* evita heredar enlace */
}

.block-card span {
  font-family: 'Poppins', sans-serif;
  font-size: 24px;
  letter-spacing: 0.3px;
}

.block-card:hover i {
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

.block-card:active {
  box-shadow: inset 0 3px 8px rgba(0,0,0,0.2);
  transform: scale(0.97);
}

/* Colores personalizados */

/* --- EJE NÚMEROS --- */
.card1 {
  background: linear-gradient(145deg, #8ac4ff, #5fa8ff, #b5d9ff);
  background-size: 250% 250%;
  animation: gradientFlow 8s ease infinite alternate;
  box-shadow: 0 0 15px rgba(95,168,255,0.3);
}

/* --- EJE ÁLGEBRA Y FUNCIONES --- */
.card2 {
  background: linear-gradient(145deg, #dcb3ff, #b983ff, #e6ccff);
  background-size: 250% 250%;
  animation: gradientFlow 8s ease infinite alternate;
  box-shadow: 0 0 15px rgba(185,131,255,0.35);
}

/* --- EJE GEOMETRÍA --- */
.card3 {
  background: linear-gradient(145deg, #6df4e1, #4ce3d1, #a7fff0);
  background-size: 250% 250%;
  animation: gradientFlow 8s ease infinite alternate;
  box-shadow: 0 0 15px rgba(109,244,225,0.3);
}

/* --- EJE PROBABILIDAD Y ESTADÍSTICA --- */
.card4 {
  background: linear-gradient(145deg, #00ffc6, #4fd1ff, #9675ff, #68c4ff);
  background-size: 300% 300%;
  animation: gradientFlow 9s ease infinite alternate;
  box-shadow: 0 0 20px rgba(79,209,255,0.4);
}

/* --- ENSAYOS CEM --- */
.card5 {
  background: linear-gradient(145deg, #fff09f, #ffd966, #ffc93c);
  background-size: 250% 250%;
  animation: gradientFlow 9s ease infinite alternate;
  box-shadow: 0 0 18px rgba(255,217,102,0.4);
}

/* --- ENSAYOS DEMRE --- */
.card7 {
  background: linear-gradient(145deg, #ffddb1, #ffb770, #ff9e45);
  background-size: 250% 250%;
  animation: gradientFlow 9s ease infinite alternate;
  box-shadow: 0 0 18px rgba(255,183,112,0.45);
}

/* --- CLASES ONLINE --- */
.card12 {
  background: linear-gradient(145deg, #a7ebff, #7dd7ff, #6ecaff);
  background-size: 250% 250%;
  animation: gradientFlow 8s ease infinite alternate;
  box-shadow: 0 0 15px rgba(125,215,255,0.4);
}

/* --- PRUEBAS TEMÁTICAS --- */
.card15 {
  background: linear-gradient(145deg, #ff9ecf, #ff6fb1, #ff5e99);
  background-size: 250% 250%;
  animation: gradientFlow 8s ease infinite alternate;
  box-shadow: 0 0 20px rgba(255,111,177,0.45);
}

/* --- TALLERES CEM --- */
.card16 {
  background: linear-gradient(145deg, #b9ffc9, #86f6a3, #66e885);
  background-size: 250% 250%;
  animation: gradientFlow 8s ease infinite alternate;
  box-shadow: 0 0 18px rgba(134,246,163,0.4);
}

/* --- CUADERNILLOS MINEDUC --- */
.card11 {
  background: linear-gradient(145deg, #c5d2ff, #9eb4ff, #bcd4ff);
  background-size: 250% 250%;
  animation: gradientFlow 8s ease infinite alternate;
  box-shadow: 0 0 16px rgba(158,180,255,0.4);
}

/* --- TEMARIOS DEMRE --- */
.card13 {
  background: linear-gradient(145deg, #b2ffe5, #86f3d1, #68e8be);
  background-size: 250% 250%;
  animation: gradientFlow 8s ease infinite alternate;
  box-shadow: 0 0 16px rgba(134,243,209,0.45);
}

/* --- PAUTAS (TOTALMENTE BLANCA) --- */
.card10 {
  background: linear-gradient(145deg, #ffffff, #ffffff, #fdfdfd);
  background-size: 200% 200%;
  animation: gradientFlow 12s ease infinite alternate;
  color: #222;
  box-shadow: 0 0 18px rgba(255,255,255,0.4);
}
.card10 span, .card10 i { color: #111 !important; }

/* --- YOUTUBE --- */
.card21 {
  background: linear-gradient(145deg, #ff5555, #ff1e1e, #ff8080);
  background-size: 250% 250%;
  animation: gradientFlow 7s ease infinite alternate;
  box-shadow: 0 0 20px rgba(255,80,80,0.45);
}

/* --- INSTAGRAM --- */
.card22 {
  background: linear-gradient(145deg, #ff85da, #ff40b4, #ff1a94, #ff5ebf);
  background-size: 300% 300%;
  animation: gradientFlow 7s ease infinite alternate;
  box-shadow: 0 0 20px rgba(255,64,180,0.45);
}



@media (max-width: 768px) {
  .cem-header {
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
  }

  .cem-logo {
    justify-content: center;
    flex: unset;
    margin-bottom: 30px;
  }

  .cem-nav {
    justify-content: center;
    flex-direction: row;
    gap: 15px;
    flex: unset;
  }
}

/* Panel Estilo APP */
.app-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #000;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.app-button {
  font-family: 'Montserrat', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.3s ease;
  animation: fadeUp 1s ease forwards;
}

.app-button svg {
  margin-bottom: 5px;
  width: 40px;
  height: 40px;
  transition: transform 0.3s ease;
}

.app-button span {
  font-family: 'Poppins', sans-serif;
}

.app-button:hover {
  transform: scale(1.1);
  color: #ffffff;
}

.app-button:active svg {
  animation: pulse 0.4s ease;
}
    
    
    @keyframes pulse-block {
    0% { transform: scale(1); }
    50% { transform: scale(1.015); }
    100% { transform: scale(1); }
    }
    
    @keyframes pulse-icon {
      0% { transform: scale(1); }
      50% { transform: scale(1.2); }
      100% { transform: scale(1); }
    }


/* Estilo del switch visual */

.switch {
  font-size: 17px;
  position: relative;
  display: inline-block;
  width: 4em;
  height: 2.2em;
  border-radius: 30px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.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;
  transition-timing-function: 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;
}

.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;
}
