/**
 * Estilos del Sistema de Novedades
 * Panel lateral izquierdo con carrusel
 */

/* ============================================
   Tab de Activación (Borde Izquierdo)
   ============================================ */
.novedades-tab {
  position: fixed;
  left: 0;
  bottom: 20px;
  background: linear-gradient(135deg, #38BDF8 0%, #0EA5E9 100%);
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  padding: 12px 16px 12px 8px;
}

.novedades-tab:hover {
  transform: translateX(5px);
  box-shadow: 3px 3px 15px rgba(56, 189, 248, 0.4);
}

.novedades-tab-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.novedades-tab-icon {
  font-size: 24px;
  animation: bounce 2s ease-in-out infinite;
}

.novedades-tab-contador {
  background: #EF4444;
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* ============================================
   Panel Lateral
   ============================================ */
.novedades-panel {
  position: fixed;
  left: -350px;
  bottom: 20px;
  width: 340px;
  max-height: 450px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 999;
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.novedades-panel.abierto {
  left: 10px;
}

/* Header del Panel */
.novedades-panel-header {
  background: linear-gradient(135deg, #38BDF8 0%, #0EA5E9 100%);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.novedades-panel-titulo {
  color: white;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.novedades-panel-acciones {
  display: flex;
  gap: 8px;
}

.btn-icono {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
  color: white;
}

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

/* Body del Panel */
.novedades-panel-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

/* Carrusel de Novedades */
.novedades-carrusel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.novedad-card {
  text-align: center;
  padding: 20px;
  animation: fadeIn 0.5s ease;
}

.novedad-icono {
  font-size: 48px;
  margin-bottom: 12px;
  animation: pulse 2s ease-in-out infinite;
}

.novedad-titulo {
  color: #1E293B;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px 0;
}

.novedad-mensaje {
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.novedad-vacia {
  text-align: center;
  color: #94A3B8;
}

.novedad-vacia p {
  margin-bottom: 16px;
}

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

/* Controles del Carrusel */
.novedades-controles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-top: 16px;
  border-top: 2px solid #E2E8F0;
}

.btn-control {
  background: #F1F5F9;
  border: 2px solid #CBD5E1;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: #475569;
  transition: all 0.2s ease;
  font-weight: bold;
}

.btn-control:hover {
  background: #38BDF8;
  border-color: #0EA5E9;
  color: white;
  transform: scale(1.05);
}

.btn-control:active {
  transform: scale(0.95);
}

.novedades-indicador {
  font-size: 14px;
  font-weight: 600;
  color: #64748B;
  min-width: 50px;
  text-align: center;
}

/* ============================================
   Modal de Administración
   ============================================ */
.novedades-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeInModal 0.3s ease;
}

@keyframes fadeInModal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.novedades-modal-content {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUpModal 0.3s ease;
}

@keyframes slideUpModal {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.novedades-modal-header {
  background: linear-gradient(135deg, #38BDF8 0%, #0EA5E9 100%);
  padding: 20px 24px;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.novedades-modal-header h2 {
  color: white;
  margin: 0;
  font-size: 22px;
}

.novedades-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Formulario de Nueva Novedad */
.novedades-form {
  background: #F8FAFC;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
}

.novedades-form h3 {
  margin: 0 0 16px 0;
  color: #1E293B;
  font-size: 16px;
}

.form-row {
  margin-bottom: 16px;
}

.form-row label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #475569;
  font-size: 14px;
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #E2E8F0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: #38BDF8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.form-row textarea {
  resize: vertical;
  min-height: 80px;
}

/* Lista de Novedades */
.novedades-lista h3 {
  margin: 0 0 16px 0;
  color: #1E293B;
  font-size: 16px;
}

.texto-vacio {
  text-align: center;
  color: #94A3B8;
  padding: 40px 20px;
}

.novedad-item {
  background: white;
  border: 2px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.novedad-item:hover {
  border-color: #38BDF8;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

.novedad-item.inactiva {
  opacity: 0.6;
  background: #F8FAFC;
}

.novedad-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.novedad-item-icono {
  font-size: 24px;
}

.novedad-item-titulo {
  flex: 1;
  font-weight: 700;
  color: #1E293B;
  font-size: 15px;
}

.novedad-item-mensaje {
  color: #64748B;
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.novedad-item-acciones {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-pequeno {
  background: #F1F5F9;
  border: 2px solid #CBD5E1;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.btn-pequeno:hover {
  background: #38BDF8;
  border-color: #0EA5E9;
  color: white;
}

.btn-pequeno.btn-danger:hover {
  background: #EF4444;
  border-color: #DC2626;
  color: white;
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #CBD5E1;
  transition: 0.3s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #10B981;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .novedades-panel {
    width: calc(100% - 20px);
    max-width: 340px;
    bottom: 10px;
  }

  .novedades-panel.abierto {
    left: 10px;
  }

  .novedades-modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .novedades-modal-body {
    padding: 16px;
  }

  .novedades-form {
    padding: 16px;
  }

  .novedad-item {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .novedades-tab {
    bottom: 10px;
    padding: 10px 12px 10px 6px;
  }

  .novedades-tab-icon {
    font-size: 20px;
  }

  .novedades-tab-contador {
    width: 18px;
    height: 18px;
    font-size: 11px;
  }

  .novedad-icono {
    font-size: 36px;
  }

  .novedad-titulo {
    font-size: 16px;
  }

  .novedad-mensaje {
    font-size: 13px;
  }

  .btn-control {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}
