/* style.css */
/* RESET Y BASE */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  position: fixed;
  width: 100.5%;
  height: 100%;
}

body {
  overflow-x: hidden;
  overflow-y: auto; /* Permite scroll vertical */
  width: 101%;
  height: 100%;
  background: url('https://i.ibb.co/k4DXKSq/ss210.gif') center/cover;
  background-repeat: repeat;
  background-size: 150px; /* tamaño del tile */
}


/* ===== ZONA ROJA --------------------------------------------------===== */
.header {
  position: relative;
  background: url('bg0.png') center/cover;
  border-bottom: none;
  display: flex; 
  flex direction: row;
 align-items: center; 
  justify-content: center; /* Centra horizontalmente */

 
}

.header-img {
  width: auto;
  height: 150px;
  object-fit: cover;
  filter: brightness(0.9);
  margin: 0 10px; 
   /* Centrado perfecto */
  justify-content: center;
  align-items: center;

}

.header-nav {
  bottom: 15px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 15px;
  padding:  8px;
  background: url('bg5.png') center/cover;
}

.header-nav a {
  background: rgba(255, 182, 193, 0.95);
  padding: 10px 20px;
  border-radius: 25px;
  text-decoration: none;
  color: #000;
  font-weight: bold;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  border: 2px solid #ffb6c1;
}

.header-nav a:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0,0,0,0.4);
}

/* ===== PARA MÓVILES MUY PEQUEÑOS (menos de 480px) ===== */
@media (max-width: 480px) {
  .header-img {
    height: 60px;
  }
}

.blueverde {
  order: 3;
}



/* ===== ZONA VERDE CON FONDOS ------------------------------------===== */
.green-zone {
  background: url('bg2.png') center/cover;
  padding: 20px 15px;
  min-height: 200px;
  width: 100%;
  overflow: hidden;
  display: block;
}

/* ===== CONTENEDOR DE ICONOS INTELIGENTE ===== */
.icons-grid {
  background: url('bg4.png') center/cover;
  padding: 15px 20px;
  
  /* Grid que se adapta automáticamente */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 90px));
  /* Auto-fit: crea tantas columnas como quepan */
  /* minmax(80px, 90px): mínimo 80px, máximo 90px (tamaño normal) */
  
  /* Centrado perfecto */
  justify-content: center;
  justify-items: center;
  align-items: center;
  
  /* Espaciado */
  gap: 15px;
  
  /* Tamaño completo */
  width: content;
  max-width: 700px;
  min-height: 20px;
  
  /* Centrado del contenedor */
  margin: 0 auto;
}

/* ===== PARA MÓVIL: ÁREA 3/4 CON ICONOS AJUSTABLES ===== */
@media (max-width: 768px) {
  .green-zone {
    /* Área 3/4 de cuadrado */
    width: 400px                  /* 75% del ancho de pantalla */
    max-width: 600px;
    

    
    /* Centrado y estética */
    margin: 0 auto 0px auto;
    padding: 15px 10px;
 
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    
    /* Sin scroll - los iconos se ajustan */
    overflow: hidden;
    
  }
  
  .icons-grid {
    /* Grid que se adapta automáticamente al espacio */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 90px));
    /* minmax(60px, 90px): mínimo 60px (reducido), máximo 90px (normal) */
    
    /* Ajusta el tamaño de las columnas al espacio disponible */
    grid-auto-columns: minmax(60px, 1fr);
    
    /* Siempre una sola fila */
    grid-auto-flow: column;
    grid-template-rows: 1fr;
    
    /* Centrado */
    justify-content: center;
    justify-items: center;
    align-items: center;
    align-content: center;
    
    /* Sin scroll */
    overflow: hidden;
    
    /* Tamaño completo del área 3/4 */
    width: 100%;
    height: 100%;
    min-height: auto;
    
    /* Espaciado dinámico */
    gap: clamp(8px, 2vw, 15px); /* Mínimo 8px, máximo 15px, adaptable */
    padding: 10px;
    
    /* Fondo ajustado */
    background-size: cover;
    background-position: center;
    border-radius: 15px;
  }
  
  /* Los iconos se ajustan automáticamente */
  .icon-card {
    /* Tamaño flexible que se adapta al grid */
    width: 100%;                 /* Ocupa el 100% de la celda grid */
    height: auto;                /* Altura proporcional */
    aspect-ratio: 90/110;        /* Mantiene proporción original 90:110 */
    
    /* Tamaños mínimos y máximos */
    min-width: 60px;             /* Mínimo cuando hay muchos iconos */
    max-width: 90px;             /* Máximo cuando caben pocos */
    min-height: 73px;            /* 60 * 110/90 ≈ 73px */
    max-height: 110px;           /* Tamaño normal */
    
    /* Transición suave para cambios de tamaño */
    transition: all 0.3s ease;
    
    /* Flex interno */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .icon-img {
    /* Imagen se ajusta al contenedor */
    width: 100%;
    height: 65%;                 /* 65% del alto total (igual proporción) */
    min-height: 39px;            /* 60% de 65px mínimo */
    max-height: 71px;            /* 65% de 110px máximo */
    object-fit: cover;
  }
  
  .icon-text {
    /* Texto se ajusta */
    height: 35%;                 /* 35% del alto total */
    min-height: 21px;            /* 35% de 60px mínimo */
    max-height: 38px;            /* 35% de 110px máximo */
    
    font-size: clamp(9px, 2vw, 12px); /* Tamaño de fuente adaptable */
    padding: clamp(2px, 1vw, 5px);
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ===== PARA MÓVILES MUY PEQUEÑOS (menos de 480px) ===== */
@media (max-width: 480px) {
  .green-zone {
    width: 200px
    max-width: 280px;
    height: 100;

  }
  
  .icons-grid {
    grid-template-columns: repeat(auto-fit, minmax(55px, 80px));
    gap: clamp(6px, 1.5vw, 12px);
    padding: 8px;
  }
  
  .icon-card {
    min-width: 55px;
    max-width: 80px;
    min-height: 67px;           /* 55 * 110/90 ≈ 67px */
    max-height: 98px;           /* 80 * 110/90 ≈ 98px */
  }
  
  .icon-text {
    font-size: clamp(8px, 1.8vw, 11px);
  }
}

/* ===== ESTILOS BASE DE TARJETAS DE ICONOS ===== */
.icon-card {
  background: rgba(165, 214, 167, 0.9);
  width: 90px;                  /* Tamaño normal por defecto */
  height: 110px;                /* Tamaño normal por defecto */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-decoration: none;
  border-radius: 0px 0px 10px 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  position: relative;
  margin: 0;
  padding: 0;
}

.icon-img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  display: block;
}

.icon-text {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 100%;
  color: #1a472a;
  font-weight: bold;
  font-size: 12px;
  text-align: center;
  padding: 5px;
  background: rgba(165, 214, 167, 0.9);
  border-radius: 0 0 10px 10px;
}

/* ===== EFECTOS HOVER ===== */
.icon-card:hover {
  transform: translateY(-5px);
  background: rgba(200, 230, 201, 0.9);
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.icon-card:hover .icon-text {
  background: rgba(200, 230, 201, 0.9);
}

.icon-card:hover .icon-img {
  filter: brightness(1.1);
}

/* Línea decorativa superior */
.icon-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
}

/* ===== MAIN LAYOUT CONTAINER ===== */
.main-container {
  display: flex;
  flex-direction: column;  /* Móvil: vertical */
  width: 100%;
  align-content: center;
  justify-content: center;
 
}

@media (min-width: 769px) {
  .main-container {
    flex-direction: row;   /* Desktop: horizontal */
  }
}


/* ===== ZONA MORADA -------------------------------------===== */
.purple-zone {
  background: url('https://i.ibb.co/c6mTR0z/ss049.gif') center/cover;
  background-repeat: repeat;
  background-size: 40px 40px; /* tamaño del tile */
  padding: 20px;
  order: 2;
}

@media (min-width: 769px) {
  .purple-zone {
    width: 200px;
    order: 1;
  }
}

.flex-links {
  display: flex;
  flex-direction: column;
  gap: 15px;
  
}

@media (max-width: 768px) {
  .flex-links {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 10px;
  }
}

.link-box {
  background: #ce93d8;
  border-radius: 10px;
  overflow: hidden;
  height: 100px;
  width: 150px;
  transition: transform 0.3s ease;
  border: 2px solid #000000;
  justify-content: center;
}

.link-box:hover {
  transform: translateY(-3px);
}

.link-box img {
  width: 150px;
  height: 100px;
  object-fit: cover;
  display: block;
}

.embed-box {
  max-height: 100px;
  max-width: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
}

.custom-box {
  padding: 15px;
  text-align: center;
  color: #4a148c;
  font-weight: bold;
}

/* TEMPLATE PARA INSERTAR */
.template-box {
  background: #e1bee7;
  padding: 15px;
  border-radius: 8px;
  margin-top: 10px;
  border: 2px dashed #ab47bc;
}

.template-box textarea {
  width: 100%;
  height: 60px;
  padding: 10px;
  border: 1px solid #ab47bc;
  border-radius: 5px;
  margin-bottom: 10px;
  resize: vertical;
}

.template-box button {
  background: #ab47bc;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
}

/* ===== ZONA AZUL----------------------------------------------------------------- ===== */
.blue-zone {
  background: url('bg3.png') center/cover;
  background-repeat: repeat;
  background-size: 400px 400px; /* tamaño del tile */
  padding: 20px;
  flex: 1;
  order: 1;
  display: flex;
  flex-direction: column;
   row-gap: 100px;
  
  
}

@media (min-width: 769px) {
  .blue-zone {
    order: 2;
  }
}

.posts-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  /* Contiene el contenido */
  width: 100%;
  /* Padding para evitar que toque los bordes */
  box-sizing: border-box;
  justify-content: center; /* Centra horizontalmente */
}

.post {
  background: #e1f5fe;
  border-radius: 12px;
  padding: 20px;
  color: #01579b;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  width: fit-content;
  height: fit-content;
  ;
}

.post-template {
  background: #b3e5fc;
  border: 2px dashed #0288d1;
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
}

.post-template h3 {
  color: #01579b;
  margin-bottom: 10px;
}

.embed-area {
  width: 100%;
  height: 100px;
  background: #e1f5fe;
  border: 1px solid #0288d1;
  border-radius: 5px;
  padding: 10px;
  margin-bottom: 10px;
}

.btn-insert {
  background: #0288d1;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

/* FORMAS GENERADAS AUTOMÁTICAMENTE */
.shape-generator {
  margin-top: 15px;
  padding: 10px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
}

.auto-shapes {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.shape {
  width: 30px;
  height: 30px;
  background: currentColor;
  opacity: 0.7;
  animation: float 3s ease-in-out infinite;
}

.shape:nth-child(1) { 
  background: #FF5252; 
  border-radius: 50%; 
  animation-delay: 0s; 
}
.shape:nth-child(2) { 
  background: #FFEB3B; 
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%); 
  animation-delay: 0.3s; 
}
.shape:nth-child(3) { 
  background: #4CAF50; 
  transform: rotate(45deg); 
  animation-delay: 0.6s; 
}
.shape:nth-child(4) { 
  background: #2196F3; 
  border-radius: 20% 80% 80% 20%; 
  animation-delay: 0.9s; 
}
.shape:nth-child(5) { 
  background: #9C27B0; 
  clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%); 
  animation-delay: 1.2s; 
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* FOOTER */
.footer {
  background: #333;
  color: #aaa;
  text-align: center;
  padding: 15px;
  font-size: 14px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .header-nav {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .header-nav a {
    font-size: 14px;
    padding: 8px 15px;
  }
  
  .icon-card {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }
  
  .link-box {
    min-width: 120px;
  }
  
  .flex-links {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 10px;
  }
  
  .link-box {
    min-width: 120px;
    flex-shrink: 0;
  }
  
  .main-container {
    flex-direction: column;
  }
  
  .purple-zone {
    width: 100%;
    order: 1;
  }
  
  .blue-zone {
    order: 2;
  }
}

/* Estilos para el textarea y áreas editables */
[contenteditable="true"]:focus {
  outline: 2px solid #0288d1;
  background: white;
}

.template-box button:hover,
.btn-insert:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

/* Scroll personalizado */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.5);
}