/* ===========================
   CALENDARIO MENSUAL LICEPAY
   Sistema de eventos sindicales
   =========================== */

.licepay-calendario-widget {
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-width: 100%;
  margin: 2rem auto;
}

/* Header del calendario */
.calendario-header {
  background: linear-gradient(135deg, #E41E26 0%, #B71C1C 100%);
  color: #FFFFFF;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendario-mes-año {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  flex: 1;
}

.calendario-nav-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #FFFFFF;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.calendario-nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.calendario-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Días de la semana */
.calendario-dias-semana {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background-color: #F5F5F5;
  border-bottom: 2px solid #E0E0E0;
}

.calendario-dia-semana {
  padding: 1rem 0.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: #424242;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Grid de días */
.calendario-dias-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: #E0E0E0;
  padding: 1px;
}

/* Celda de día */
.calendario-dia {
  background: #FFFFFF;
  min-height: 80px;
  padding: 0.5rem;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendario-dia:hover {
  background-color: #FFF3F3;
  transform: scale(1.02);
  z-index: 1;
}

.calendario-dia.otro-mes {
  background-color: #FAFAFA;
  opacity: 0.5;
}

.calendario-dia.hoy {
  background: linear-gradient(135deg, rgba(228, 30, 38, 0.1) 0%, rgba(106, 27, 154, 0.1) 100%);
  border: 2px solid #E41E26;
}

.calendario-dia.con-evento {
  background-color: #FFF9F9;
}

/* Número del día */
.dia-numero {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.9rem;
  color: #212121;
  margin-bottom: 0.25rem;
}

.calendario-dia.hoy .dia-numero {
  background-color: #E41E26;
  color: #FFFFFF;
}

/* Eventos en el día */
.dia-eventos {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.evento-badge {
  background-color: #E41E26;
  color: #FFFFFF;
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: all 0.2s ease;
}

.evento-badge:hover {
  background-color: #B71C1C;
  transform: translateX(2px);
}

.evento-badge.tipo-reunion {
  background-color: #E41E26;
}

.evento-badge.tipo-asamblea {
  background-color: #6A1B9A;
}

.evento-badge.tipo-formacion {
  background-color: #1976D2;
}

.evento-badge.tipo-festivo {
  background-color: #388E3C;
}

.evento-badge.tipo-otro {
  background-color: #F57C00;
}

/* Indicador de más eventos */
.mas-eventos {
  font-size: 0.7rem;
  color: #E41E26;
  font-weight: 600;
  margin-top: 0.25rem;
  cursor: pointer;
}

.mas-eventos:hover {
  text-decoration: underline;
}

/* Modal de evento */
.evento-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.evento-modal.active {
  display: flex;
}

.evento-modal-content {
  background: #FFFFFF;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.evento-modal-header {
  background: linear-gradient(135deg, #E41E26 0%, #B71C1C 100%);
  color: #FFFFFF;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.evento-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #FFFFFF;
}

.evento-modal-close {
  background: none;
  border: none;
  color: #FFFFFF;
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.evento-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.evento-modal-body {
  padding: 1.5rem;
}

.evento-detalle {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #E0E0E0;
}

.evento-detalle:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.evento-titulo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #E41E26;
  margin-bottom: 0.5rem;
}

.evento-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: #424242;
  font-size: 0.9rem;
}

.evento-info-icon {
  color: #E41E26;
  font-weight: 700;
}

.evento-descripcion {
  color: #212121;
  line-height: 1.6;
  margin-top: 0.75rem;
}

.evento-tipo-label {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.5rem;
}

/* Leyenda de tipos */
.calendario-leyenda {
  padding: 1rem 1.5rem;
  background-color: #F5F5F5;
  border-top: 1px solid #E0E0E0;
}

.calendario-leyenda h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #424242;
  margin-bottom: 0.75rem;
}

.leyenda-items {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.leyenda-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.leyenda-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

/* Botón de hoy */
.calendario-hoy-btn {
  background-color: #FFFFFF;
  color: #E41E26;
  border: 2px solid #E41E26;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0 0.5rem;
}

.calendario-hoy-btn:hover {
  background-color: #E41E26;
  color: #FFFFFF;
}

/* Responsive */
@media (max-width: 768px) {
  .calendario-header {
    padding: 1rem;
  }
  
  .calendario-mes-año {
    font-size: 1.2rem;
  }
  
  .calendario-nav-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .calendario-dia-semana {
    padding: 0.75rem 0.25rem;
    font-size: 0.75rem;
  }
  
  .calendario-dia {
    min-height: 60px;
    padding: 0.25rem;
  }
  
  .dia-numero {
    width: 24px;
    height: 24px;
    line-height: 24px;
    font-size: 0.8rem;
  }
  
  .evento-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
  }
  
  .evento-modal-content {
    margin: 1rem;
  }
  
  .calendario-hoy-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
}

@media (max-width: 480px) {
  .calendario-dia {
    min-height: 50px;
  }
  
  .evento-badge {
    display: none;
  }
  
  .calendario-dia.con-evento::after {
    content: '•';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    color: #E41E26;
    font-size: 1.5rem;
    line-height: 1;
  }
}

/* Loading state */
.calendario-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.calendario-loading::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 4px solid #E0E0E0;
  border-top-color: #E41E26;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Accesibilidad */
.calendario-dia:focus,
.evento-badge:focus,
.calendario-nav-btn:focus {
  outline: 2px solid #E41E26;
  outline-offset: 2px;
}
