/* ================================================
   SEGUIMIENTO DE TRÁMITE - CSS MODERNO
   ================================================ */

/* Variables */
:root {
  --primary: #6c5ce7;
  --primary-dark: #5a4bd1;
  --primary-light: #a29bfe;
  --accent: #74b9ff;
  --accent-light: #81ecec;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #d63031;
  --info: #0984e3;
  --gray: #2d3436;
  --gray-light: #636e72;
  --gray-lighter: #b2bec3;
  --white: #ffffff;
  --bg-light: #f8f9fa;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body */
body {
  font-family: "Inter", "Segoe UI", -apple-system, sans-serif;
  background: linear-gradient(135deg, #1a1534 0%, #2d1b4e 50%, #3d2463 100%);
  min-height: 100vh;
  color: var(--gray);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Fondo con estrellas */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(
      1.5px 1.5px at 20% 30%,
      rgba(255, 255, 255, 0.8),
      transparent
    ),
    radial-gradient(1px 1px at 60% 70%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(
      1.5px 1.5px at 80% 10%,
      rgba(255, 255, 255, 0.5),
      transparent
    ),
    radial-gradient(1px 1px at 90% 60%, rgba(255, 255, 255, 0.6), transparent);
  background-size: 400px 400px, 350px 350px, 300px 300px, 450px 450px,
    380px 380px;
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
}

/* Logo Header (solo escritorio, en mobile lo ocultamos) */
.muni-logo-header {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  background: white;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.muni-logo-header img {
  height: 45px;
  width: auto;
}

/* Botón Volver */
.btn-volver {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  text-decoration: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.btn-volver:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Container Principal */
.container-principal {
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 20px 60px;
  position: relative;
  z-index: 1;
}

/* Header Seguimiento */
.header-seguimiento {
  text-align: center;
  margin-bottom: 50px;
  animation: fadeInDown 0.6s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(108, 92, 231, 0.4);
  animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.header-icon i {
  font-size: 2.5rem;
  color: white;
}

.titulo-principal {
  font-size: 3rem;
  font-weight: 700;
  color: white;
  margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.subtitulo {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
}

/* ========================================
   MODAL DE BÚSQUEDA
   ======================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-busqueda {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh; /* 👈 importante para móviles */
  overflow-y: auto; /* 👈 scroll interno si es muy alta */
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  text-align: center;
  margin-bottom: 30px;
}

.modal-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 20px;
  background: linear-gradient(
    135deg,
    var(--primary-light),
    var(--accent-light)
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon i {
  font-size: 2rem;
  color: var(--primary);
}

.modal-header h2 {
  font-size: 1.8rem;
  color: var(--gray);
  margin-bottom: 8px;
}

.modal-subtitle {
  color: var(--gray-light);
  font-size: 0.95rem;
}

.modal-body {
  margin-top: 20px;
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--gray);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.form-group label i {
  color: var(--primary);
}

.input-field {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e9ecef;
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: var(--transition);
  font-family: inherit;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

.btn-buscar {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.btn-buscar:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(108, 92, 231, 0.4);
}

.modal-footer {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.ayuda-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--gray-light);
  text-align: center;
  justify-content: center;
}

.ayuda-text i {
  color: var(--info);
}

/* ========================================
   LOADING OVERLAY
   ======================================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}

.loading-spinner {
  text-align: center;
  color: white;
}

.loading-spinner i {
  font-size: 4rem;
  color: var(--primary-light);
  margin-bottom: 20px;
}

.loading-spinner p {
  font-size: 1.2rem;
  font-weight: 500;
}

/* ========================================
   RESULTADOS
   ======================================== */

.resultados-container {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.resultados-container.show {
  opacity: 1;
  transform: translateY(0);
}

/* Card de Información */
.documento-info-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.info-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f8f9fa;
}

.info-header i {
  font-size: 1.8rem;
  color: var(--primary);
}

.info-header h3 {
  font-size: 1.5rem;
  color: var(--gray);
}

.info-body {    
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.info-label {
  font-size: 0.85rem;
  color: var(--gray-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: 1.1rem;
  color: var(--gray);
  font-weight: 600;
}

/* Timeline Header */
.timeline-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  color: white;
}

.timeline-header i {
  font-size: 1.8rem;
  color: var(--accent-light);
}

.timeline-header h3 {
  font-size: 1.8rem;
  font-weight: 600;
}

/* Timeline Container */
.timeline-container {
  position: relative;
  padding-left: 40px;
}

.timeline-container::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary), transparent);
}

/* Timeline Item */
.timeline-item {
  position: relative;
  margin-bottom: 30px;
  animation: fadeInLeft 0.5s ease;
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.timeline-marker {
  position: absolute;
  left: -40px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.2);
  z-index: 2;
}

.timeline-marker i {
  font-size: 0.9rem;
}

/* Estados */
.timeline-item.pendiente .timeline-marker {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(253, 203, 110, 0.2);
}

.timeline-item.pendiente .timeline-marker i {
  color: white;
}

.timeline-item.recibido .timeline-marker {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(0, 184, 148, 0.2);
}

.timeline-item.recibido .timeline-marker i {
  color: white;
}

.timeline-item.observado .timeline-marker {
  background: #0056b3;
  box-shadow: 0 0 0 4px rgba(18, 57, 233, 0.2);
}

.timeline-item.observado .timeline-marker i {
  color: white;
}

.timeline-item.finalizado .timeline-marker {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.2);
}

.timeline-item.finalizado .timeline-marker i {
  color: white;
}

.timeline-item.bloqueado .timeline-marker {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(214, 48, 49, 0.2);
}

.timeline-item.bloqueado .timeline-marker i {
  color: white;
}

.timeline-item.procesado .timeline-marker {
  background: var(--gray-lighter);
  box-shadow: 0 0 0 4px rgba(178, 190, 195, 0.2);
}

.timeline-item.procesado .timeline-marker i {
  color: white;
}

/* Timeline Content */
.timeline-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px 25px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.timeline-content:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(5px);
}

.timeline-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

.timeline-header-content h4 {
  font-size: 1.2rem;
  color: var(--gray);
  margin: 0;
}

/* Badges */
.timeline-badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-pendiente {
  background: rgba(253, 203, 110, 0.2);
  color: #e17055;
}

.badge-recibido {
  background: rgba(0, 184, 148, 0.2);
  color: #00b894;
}

.badge-finalizado {
  background: rgba(108, 92, 231, 0.2);
  color: var(--primary);
}

.badge-bloqueado {
  background: rgba(214, 48, 49, 0.2);
  color: var(--danger);
}

.badge-observado {
  background: rgba(46, 17, 214, 0.2);
  color: #0056b3;
}

.badge-procesado {
  background: rgba(178, 190, 195, 0.2);
  color: var(--gray-light);
}

/* Timeline Details */
.timeline-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--gray-light);
}

.detail-item i {
  color: var(--primary);
  margin-top: 2px;
  flex-shrink: 0;
}

.detail-item.observacion {
  background: #fff3cd;
  padding: 10px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warning);
}

/* Sin Resultados */
.sin-resultados {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  animation: fadeIn 0.5s ease;
}

.sin-resultados-icon {
  width: 100px;
  height: 100px;
  margin-bottom: 25px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;  
}

.sin-resultados-icon i {
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.7);
}

.sin-resultados h3 {
  font-size: 1.8rem;
  color: white;
  margin-bottom: 15px;
}

.sin-resultados p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 30px;
}

/* Botones de Acción */
.acciones-container {
  text-align: center;
  margin-top: 40px;
}

.btn-nueva-busqueda,
.btn-reintentar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-nueva-busqueda:hover,
.btn-reintentar:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  /* Ocultar logo SOLO en móviles */
  .muni-logo-header {
    display: none !important;
  }

  .btn-volver {
    top: 10px;
    right: 10px;
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  .btn-volver span {
    display: none;
  }

  .container-principal {
    padding: 100px 15px 40px;
  }

  .titulo-principal {
    font-size: 2rem;
  }

  .subtitulo {
    font-size: 1rem;
  }

  /* Modal mejor encajado en móviles */
  .modal-busqueda {
    width: 100%;
    max-width: 420px;
    margin: 0 16px;
    padding: 28px 20px;
    border-radius: 18px;
  }

  .info-body {
    grid-template-columns: 1fr;
  }

  .timeline-container {
    padding-left: 35px;
  }

  .timeline-marker {
    left: -35px;
    width: 28px;
    height: 28px;
  }

  .timeline-header-content {
    flex-direction: column;
    align-items: flex-start;
  }
}
