/* ===============================
   BASE CALENDARIO
   (NO HEADER / NO FOOTER)
================================ */

.calendar-wrapper,
.calendar-wrapper * {
  box-sizing: border-box;
}


/* ===============================
   CONTENEDOR CALENDARIO
================================ */

.calendar-container {
  background-color: #ffffff;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

/* ===============================
   CONTROLES DE MES
================================ */

.calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.calendar-controls h2 {
  font-size: 24px;
  font-weight: bold;
  color: #b30000;
  text-transform: capitalize;
}

.calendar-controls button {
  background-color: #b30000;
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
}

.calendar-controls button:hover {
  background-color: #8f0000;
}

/* ===============================
   DIAS DE LA SEMANA
================================ */

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: bold;
  padding: 10px 0;
  background-color: #eeeeee;
  border-radius: 6px;
  margin-bottom: 10px;
}

.weekdays div {
  font-size: 14px;
  color: #444;
}

/* ===============================
   GRILLA DE DIAS
================================ */

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}

.day {
  min-height: 110px;
  background-color: #fafafa;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
}

.day:hover {
  background-color: #f0f0f0;
}

.day-number {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 6px;
}

.day.empty {
  background-color: transparent;
  border: none;
  cursor: default;
}

/* ===============================
   EVENTOS
================================ */

.event {
  display: block;
  font-size: 10px;
  margin-top: 4px;
  padding: 2px;
  border-radius: 4px;
  color: white;
  overflow: hidden;
  white-space: nowrap;
}

.event.green {
  background-color: #198754;
}

.event.red {
  background-color: #dc3545;
}

.event.yellow {
  background-color: #ffc107;
  color: #000;
}

/* FERIADOS */
.event.holiday {
  background-color: #d4a000;
}

/* ===============================
   LEYENDA
================================ */

.calendar-legend {
  background-color: #ffffff;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  height: fit-content;
}

.calendar-legend h3 {
  color: #b30000;
  margin-bottom: 20px;
  text-align: center;
  font-size: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 14px;
}

.legend-color {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.legend-color.red {
  background-color: #b30000;
}

.legend-color.green {
  background-color: #1f8f3a;
}

.legend-color.yellow {
  background-color: #d4a000;
}

/* ===============================
   MODAL EVENTO
================================ */

.modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.hidden {
  display: none;
}

.modal-content {
  background-color: #ffffff;
  padding: 25px;
  width: 340px;
  border-radius: 10px;
  position: relative;
  text-align: center;
}

.modal-content h3 {
  color: #b30000;
  margin-bottom: 10px;
}

.modal-content p {
  font-size: 14px;
  color: #444;
}

#closeModal {
  position: absolute;
  top: 10px;
  right: 14px;
  cursor: pointer;
  font-size: 18px;
}

.torneo-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.torneo-modal-overlay.hidden {
  display: none !important;
}

.torneo-modal {
  background: #fff;
  width: 90%;
  max-width: 520px;
  padding: 25px;
  border-radius: 18px;
  position: relative;
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 16px;
  cursor: pointer;
  font-size: 22px;
  font-weight: bold;
}

.torneo-image {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 15px;
}

.info-item {
  margin-bottom: 10px;
}


/* =========================
   BOTONES GOOGLE CALENDAR
========================= */

.calendar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 24px;
}

.calendar-btn {
  text-decoration: none;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  transition: 0.2s ease;
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.google-btn {
  background: #198754;
}

.google-btn:hover {
  background: #157347;
  transform: translateY(-2px);
}

.public-btn {
  background: #0d6efd;
}

.public-btn:hover {
  background: #0b5ed7;
  transform: translateY(-2px);
}
/* ===============================
   RESPONSIVE
================================ */

@media (max-width: 1024px) {
  .calendar-wrapper {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .day {
    min-height: 90px;
  }
}

@media (max-width: 480px) {
  .weekdays div {
    font-size: 12px;
  }

  .day-number {
    font-size: 12px;
  }
}
