/* ============================================================
   ESTILOS MÓDULO ASISTENCIAS - PALETA URBANI MORADO
   Usa variables globales de styles.css
   ============================================================ */

/* ===== MODAL ASISTENCIA ===== */
.modal-asistencia {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 27, 75, 0.75);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-asistencia.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

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

.modal-asistencia-content {
  background: #ffffff;
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(91, 33, 182, 0.35);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(167, 139, 250, 0.15);
}

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

.modal-asistencia-header {
  padding: 22px 26px;
  border-bottom: 1px solid rgba(167, 139, 250, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #7C3AED, #5B21B6);
  border-radius: 24px 24px 0 0;
}

.modal-asistencia-header h2 {
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.3px;
}

.btn-close-modal {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-close-modal:hover { background: rgba(255,255,255,0.25); }

/* ===== PANEL BODY ===== */
.panel-body { padding: 26px; }

/* ===== RELOJ DIGITAL ===== */
.reloj-digital {
  text-align: center;
  margin-bottom: 24px;
  padding: 22px;
  background: linear-gradient(135deg, #7C3AED, #8B5CF6);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.3);
}

.hora-actual {
  font-size: 48px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -2px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.2);
  font-variant-numeric: tabular-nums;
}

.fecha-actual {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  text-transform: capitalize;
  margin-top: 8px;
}

/* ===== CÁMARA ===== */
.camera-container {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 18px;
  background: #0F0A1E;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

#videoElement {
  width: 100%;
  height: auto;
  display: block;
}

.camera-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.camera-frame {
  width: 280px;
  height: 280px;
  border: 4px solid #A78BFA;
  border-radius: 50%;
  box-shadow:
    0 0 0 2000px rgba(0,0,0,0.28),
    0 0 32px rgba(167, 139, 250, 0.4);
}

/* ===== FOTO PREVIEW ===== */
.foto-preview {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

#fotoPreviewImg {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== BOTONES MARCAJE ===== */
.botones-marcaje {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.btn-marcaje {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  width: 100%;
}

.btn-marcaje:not([disabled]):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.18);
}

.btn-marcaje:not([disabled]):active { transform: translateY(0); }
.btn-marcaje[disabled] { pointer-events: none; }

.btn-entrada { background: linear-gradient(135deg, #10b981, #059669); color: #ffffff; }
.btn-comida  { background: linear-gradient(135deg, #f59e0b, #d97706); color: #ffffff; }
.btn-salida  { background: linear-gradient(135deg, #ef4444, #dc2626); color: #ffffff; }

.btn-icon { font-size: 22px; display: flex; align-items: center; flex-shrink: 0; }
.btn-icon svg { width: 22px; height: 22px; stroke: currentColor; }

.btn-text {
  flex: 1;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mensaje-completo {
  text-align: center;
  padding: 22px;
  background: linear-gradient(135deg, #F5F3FF, #EDE9FE);
  border-radius: 14px;
  color: #5B21B6;
  font-weight: 700;
  font-size: 15px;
  border: 1px solid rgba(167, 139, 250, 0.3);
}

/* ===== ACCIONES ===== */
.acciones-camara,
.acciones-confirmar {
  display: flex;
  gap: 12px;
  flex-direction: column;
}

.btn-capturar {
  background: linear-gradient(135deg, #7C3AED, #5B21B6);
  color: #ffffff;
  border: none;
  padding: 15px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}

.btn-capturar:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45);
  background: linear-gradient(135deg, #6D28D9, #4C1D95);
}

/* ===== ESTADO PROCESO ===== */
.estado-proceso {
  text-align: center;
  padding: 40px 20px;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 5px solid rgba(167, 139, 250, 0.2);
  border-top-color: #7C3AED;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin { to { transform: rotate(360deg); } }

#mensajeProceso {
  font-size: 15px;
  font-weight: 600;
  color: #5B21B6;
}

.success-icon,
.error-icon {
  font-size: 60px;
  margin-bottom: 16px;
}

/* ===== BOTÓN MI ASISTENCIA EN SIDEBAR ===== */
.btn-mi-asistencia {
  margin: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #06B6D4, #0891B2);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.5);
  letter-spacing: 0.3px;
}

.btn-mi-asistencia:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.6);
  background: linear-gradient(135deg, #0891B2, #0E7490);
}

/* ===== TABLA ASISTENCIAS CON FOTO ===== */
.asistencia-foto-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  border: 2px solid rgba(167, 139, 250, 0.3);
}

.asistencia-foto-thumb:hover {
  transform: scale(1.55);
  z-index: 100;
  position: relative;
  border-color: #7C3AED;
}

.ubicacion-link {
  color: #7C3AED;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}

.ubicacion-link:hover { text-decoration: underline; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .modal-asistencia {
    padding: 0;
    align-items: flex-end;
  }
  .modal-asistencia-content {
    max-width: 100%;
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 95vh;
  }
  .panel-body { padding: 16px; }
  .hora-actual { font-size: 38px; letter-spacing: -1px; }
  .reloj-digital { padding: 16px; margin-bottom: 16px; }
  .camera-frame { width: 200px; height: 200px; }
  .btn-marcaje { padding: 12px 14px; font-size: 13px; gap: 12px; }
  .btn-icon svg { width: 20px; height: 20px; }
  .botones-marcaje { gap: 8px; }
}

@media (max-width: 380px) {
  .hora-actual { font-size: 32px; }
  .camera-frame { width: 170px; height: 170px; }
  .btn-marcaje { padding: 11px 12px; font-size: 12px; }
}
