/* ===========================
   LAYOUT SECCIÓN CALENDARIO
   =========================== */

.calendar-section {
  max-width: 1040px;   /* antes 1100px */
  margin: 32px auto 0;
  padding-inline: 16px; /* antes 24px */
}

.calendar-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* mitad y mitad */
  gap: 32px;
  align-items: flex-start;
}

/* MITAD IZQUIERDA: CUADRÍCULA DE 4 BLOQUES */

.calendar-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-left: -80px;   /* desplaza SOLO los cuadrados hacia la izquierda */
}

/* Corrige el desplazamiento en pantallas pequeñas */
@media screen and (max-width: 1200px) {
  .calendar-info-grid {
    margin-left: -50px; /* un poco menos en pantallas medianas */
  }
}

@media screen and (max-width: 960px) {
  .calendar-info-grid {
    margin-left: 0; /* centrado en móviles/tablets */
  }
}

/* Cada bloque tiene tamaño fijo, el texto NO cambia el tamaño */
.info-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 60%),
              rgba(5, 10, 35, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.75);
  cursor: pointer;
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    border-color 0.18s ease-out,
    background 0.18s ease-out;
  height: 230px; /* ALTURA FIJA */
}

.info-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85);
  border-color: rgba(255, 203, 5, 0.7);
}

.info-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;     /* centra verticalmente */
  justify-content: center; /* centra horizontalmente */
  text-align: center;      /* centra el texto internamente */
  padding: 18px 20px;
  overflow: hidden;
}

.info-card-image,
.info-card-text {
  display: none;
}

.info-card--image .info-card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-card--text .info-card-text {
  width: 100%;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #f5f7ff;
  word-wrap: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 8;  /* número de líneas visibles */
  -webkit-box-orient: vertical;
}

/* MITAD DERECHA: CONTENEDOR DEL CALENDARIO */

.calendar-panel {
  display: flex;
  justify-content: flex-end;
}

/* ===========================
   CAJA DEL CALENDARIO
   =========================== */

#calendar {
  --accent: #ffcb05;
  --accent-soft: rgba(255, 203, 5, 0.18);
  --bg-glass: rgba(8, 14, 40, 0.7);

  max-width: 620px;
  width: 100%;
  margin-left: auto;
  padding: 12px 14px 16px;
  border-radius: 22px;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.1), transparent 55%),
              var(--bg-glass);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

#calendar::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(0, 255, 200, 0.22),
    rgba(165, 105, 255, 0.22),
    rgba(255, 203, 5, 0.25)
  );
  opacity: 0.45;
  mix-blend-mode: soft-light;
}

#calendar > * {
  position: relative;
  z-index: 1;
}

/* ===========================
   CABECERA DEL CALENDARIO
   =========================== */

#calendar .calendar-header {
  width: 100%;
  background: linear-gradient(135deg, rgba(21, 32, 78, 0.95), rgba(14, 20, 55, 0.95));
  border-radius: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 72px 12px; /* sitio para flechas laterales */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
  row-gap: 6px;
}

#calendar .calendar-header h1 {
  margin: 0;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.03em;
  text-transform: capitalize;
  text-align: center;
}

.calendar-header-controls {
  min-height: 24px;              /* reserva el hueco del botón */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Botón IR A HOY (lo crea el JS solo cuando no es el mes actual) */

.calendar-today-btn {
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-width: 1px;
  background: rgba(5, 10, 35, 0.9);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.calendar-today-btn:hover {
  transform: translateY(-1px);
  border-color: #ffcb05;
}

/* Flechas */

#calendar .calendar-prev,
#calendar .calendar-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.1), transparent 60%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.65);
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    border-color 0.18s ease-out,
    background 0.18s ease-out;
  font-size: 20px;
  line-height: 1;
}

#calendar .calendar-prev { left: 18px; }
#calendar .calendar-next { right: 18px; }

#calendar .calendar-prev:hover,
#calendar .calendar-next:hover {
  transform: translateY(-50%) translateY(-1px) scale(1.04);
  border-color: var(--accent);
  background: radial-gradient(circle at top, rgba(255, 203, 5, 0.22), transparent 60%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.8);
}

/* ===========================
   MES / DÍAS
   =========================== */

#calendar .calendar-month {
  width: 100%;
  margin-top: 14px;
  border-radius: 16px;
  padding: 10px 6px 6px;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 65%),
              rgba(3, 10, 35, 0.9);
}

#calendar .calendar-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

#calendar .calendar-day {
  width: auto;
  text-align: center;
  padding: 8px 4px 10px;
  box-sizing: border-box;
  position: relative;
  min-height: 56px;
  color: #f8f9ff;
  cursor: pointer;
  transition:
    transform 0.14s ease-out,
    background 0.14s ease-out,
    box-shadow 0.14s ease-out,
    border-color 0.14s ease-out;
  border-radius: 12px;
}

#calendar .calendar-day:hover {
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.05), transparent 60%);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55);
}

#calendar .calendar-day.other {
  color: rgba(255, 255, 255, 0.35);
}

#calendar .calendar-day.today {
  color: #ffffff;
  border-radius: 12px;
  border: 1px solid rgba(156, 202, 235, 0.9);
  box-shadow:
    0 0 0 1px rgba(156, 202, 235, 0.4),
    0 0 18px rgba(156, 202, 235, 0.65);
  background: radial-gradient(circle, rgba(156, 202, 235, 0.22), transparent 65%);
}

#calendar .calendar-day-name {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  margin-bottom: 4px;
  padding: 4px 0;
  background: rgba(0, 0, 0, 0.32);
  border-radius: 999px;
}

#calendar .calendar-day-number {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

/* Punto de evento */

.calendar-event-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin: 4px auto 0;
  background: #ffcb05;
  box-shadow: 0 0 10px rgba(255, 203, 5, 0.8);
  position: relative;
}

.calendar-event-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.18);
  opacity: 0.7;
}

.calendar-event-dot.kick {
  background: #00c853;
  box-shadow: 0 0 10px rgba(0, 200, 83, 0.85);
}
.calendar-event-dot.tiktok {
  background: #ff1744;
  box-shadow: 0 0 10px rgba(255, 23, 68, 0.85);
}
.calendar-event-dot.both {
  background: linear-gradient(90deg, #00c853 50%, #ff1744 50%);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.7);
}

/* ===========================
   OVERLAY + MODALES
   =========================== */

.event-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.88));
  z-index: 200;
  backdrop-filter: blur(8px);
}

.event-modal,
.panel-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 201;
  max-width: 520px;
  width: 92%;
  padding: 2px;
  border-radius: 20px;
  background: linear-gradient(
    135deg,
    rgba(0, 255, 200, 0.5),
    rgba(165, 105, 255, 0.5),
    rgba(255, 203, 5, 0.7)
  );
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
}

.event-modal-inner,
.panel-modal-inner {
  background: radial-gradient(circle at top left, rgba(15, 21, 60, 0.98), rgba(4, 7, 28, 0.98));
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.event-modal-inner h2,
.panel-modal-inner h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  letter-spacing: 0.03em;
}

.event-date-label,
.panel-slot-label {
  font-size: 0.86rem;
  opacity: 0.9;
  margin-bottom: 10px;
  color: #9cc9ff;
}

.event-summary {
  font-size: 0.9rem;
  margin-bottom: 10px;
  line-height: 1.6;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}
.event-summary .summary-line { margin-bottom: 3px; }
.event-summary .summary-label {
  font-weight: 600;
  color: var(--accent);
}

.event-top-buttons,
.panel-buttons-row,
.event-buttons-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}

/* Form evento */

#eventForm label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 10px;
}
#eventForm input[type="time"],
#eventForm input[type="text"],
#eventForm textarea {
  width: 100%;
  margin-top: 4px;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  outline: none;
  background: rgba(2, 8, 32, 0.9);
  color: #f6f7ff;
  font-size: 0.85rem;
  transition:
    border-color 0.15s ease-out,
    box-shadow 0.15s ease-out,
    background 0.15s ease-out;
}
#eventForm input[type="time"]:focus,
#eventForm input[type="text"]:focus,
#eventForm textarea:focus {
  border-color: var(--accent);
  background: rgba(6, 16, 50, 0.98);
  box-shadow: 0 0 0 1px rgba(255, 203, 5, 0.55);
}
.event-platforms-fieldset {
  border: none;
  margin-bottom: 10px;
  padding: 0;
}
.event-platforms-fieldset legend {
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.platform-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 12px;
  font-size: 0.86rem;
}
.platform-option input[type="checkbox"] { transform: scale(1.05); }
#eventForm textarea { resize: vertical; min-height: 70px; }

/* Form panel */

#panelForm { font-size: 0.85rem; }
.panel-mode-fieldset {
  border: none;
  margin: 0 0 10px;
  padding: 0;
}
.panel-mode-fieldset legend { margin-bottom: 4px; }
.panel-mode-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 12px;
}
.panel-text-label,
.panel-image-label {
  display: block;
  margin-bottom: 10px;
}
.panel-text-label textarea,
.panel-image-label input {
  width: 100%;
  margin-top: 4px;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  outline: none;
  background: rgba(2, 8, 32, 0.9);
  color: #f6f7ff;
  font-size: 0.85rem;
  transition:
    border-color 0.15s ease-out,
    box-shadow 0.15s ease-out,
    background 0.15s ease-out;
}
.panel-text-label textarea {
  resize: vertical;
  min-height: 70px;
}
.panel-text-label textarea:focus,
.panel-image-label input:focus {
  border-color: var(--accent);
  background: rgba(6, 16, 50, 0.98);
  box-shadow: 0 0 0 1px rgba(255, 203, 5, 0.55);
}

#panelForm.mode-text .panel-image-label { display: none; }
#panelForm.mode-image .panel-text-label { display: none; }

/* ===========================
   UTILIDAD
   =========================== */

.hidden {
  display: none !important;
}

/* ===========================
   RESPONSIVE
   =========================== */

@media screen and (max-width: 960px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }
  .calendar-panel {
    justify-content: center;
  }
}

@media screen and (max-width: 600px) {
  .calendar-info-grid {
    grid-template-columns: 1fr;
  }
  #calendar {
    max-width: 100%;
  }
}
