/* 
  =============================================
  VARIABLES GLOBALES
  Define los colores y valores reutilizables en todo el sitio
  =============================================
*/
:root {
  --pjudicial-primary: #9E1F20;   /* Rojo institucional */
  --pjudicial-secondary: #00558C; /* Azul complementario */
  --pjudicial-dark: #2C2C2C;      /* Color para texto principal */
  --pjudicial-light: #F8F9FA;     /* Color de fondo claro */
  --pjudicial-accent: #D4AF37;    /* Dorado para acentos */
}

/* 
  =============================================
  ESTILOS BASE
  Estilos fundamentales para la estructura HTML
  =============================================
*/
html, body {
  height: 100%;
  font-family: 'Roboto', sans-serif;
  color: var(--pjudicial-dark);
  background-color: var(--pjudicial-light);
  line-height: 1.6;
}

/* Contenedor principal para sticky footer */
#page-container {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Contenedor de contenido para sticky footer */
#content-wrap {
  flex: 1;
}

/* Estilos base para encabezados */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--pjudicial-primary);
}

/* 
  =============================================
  COMPONENTE NAVBAR
  Estilos para la barra de navegación principal
  =============================================
*/
.navbar {
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

/* Navbar al hacer scroll */
.navbar.scrolled {
  padding: 0.3rem 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(5px);
}

/* Logo en el navbar */
.navbar-brand img {
  height: 50px;
  width: 50px;
  object-fit: cover;
  transition: all 0.3s ease;
}

/* Logo al hacer scroll */
.navbar.scrolled .navbar-brand img {
  height: 40px;
  width: 40px;
}

/* Texto del navbar */
.navbar-brand div.text-dark {
  transition: all 0.3s ease;
  line-height: 1.2;
}

/* Texto al hacer scroll */
.navbar.scrolled .navbar-brand div.text-dark {
  font-size: 1.2rem;
}

/* Enlaces del navbar */
.nav-link {
  color: var(--pjudicial-dark) !important;
  font-weight: 500;
  padding: 0.5rem 1rem;
  margin: 0 0.2rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
}

/* Efecto subrayado al pasar el mouse */
.nav-link:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--pjudicial-primary);
  transition: width 0.3s ease;
}

.nav-link:hover:after, 
.nav-link.active:after {
  width: 100%;
}

.nav-link:hover, 
.nav-link.active {
  color: var(--pjudicial-primary) !important;
}

/* Menú desplegable */
.dropdown-menu {
  border: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.3s ease-out;
}

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

/* Items del menú desplegable */
.dropdown-item {
  color: var(--pjudicial-dark);
  padding: 0.5rem 1.5rem;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: var(--pjudicial-primary);
  color: white;
  transform: translateX(5px);
}

/* 
  =============================================
  SECCIONES HERO
  Estilos para las secciones hero (inicio y ubicación)
  =============================================
*/
.search-hero, .location-hero {
  background: linear-gradient(135deg, rgba(158, 31, 32, 0.8) 0%, rgba(0, 85, 140, 0.8) 100%), 
              url('../../imagen/fachada_corte.jpeg') center/cover no-repeat;
  position: relative;
  overflow: hidden;
}

/* Hero específico para la página de inicio */
.search-hero {
  height: 500px;
  display: flex;
  align-items: center;
  animation: backgroundZoom 20s infinite alternate;
}

/* Hero específico para la página de ubicación */
.location-hero {
  padding: 100px 0;
}

/* Animación de zoom para el fondo */
@keyframes backgroundZoom {
  0% { background-size: 100% auto; }
  100% { background-size: 110% auto; }
}

/* Contenedor del contenido hero */
.search-container, .location-container {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  padding: 2.5rem;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Animación específica para el buscador */
.search-container {
  animation: fadeInUp 0.8s ease-out;
  transform-style: preserve-3d;
  backdrop-filter: blur(2px);
}

/* Efecto de borde animado al pasar el mouse */
.search-container:before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(45deg, var(--pjudicial-primary), var(--pjudicial-secondary));
  z-index: -1;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.search-container:hover:before {
  opacity: 0.3;
}

/* Animación de aparición */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 
  =============================================
  COMPONENTES DE BOTONES
  Estilos para botones primarios y secundarios
  =============================================
*/
.btn-primary {
  background-color: var(--pjudicial-primary);
  border-color: var(--pjudicial-primary);
  padding: 0.5rem 1.75rem;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Efecto hover para botón primario */
.btn-primary:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: rgba(0,0,0,0.1);
  transition: width 0.3s ease;
  z-index: -1;
}

.btn-primary:hover:after {
  width: 100%;
}

.btn-primary:hover {
  background-color: var(--pjudicial-primary);
  border-color: var(--pjudicial-primary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(158, 31, 32, 0.3);
}

/* Botón outline */
.btn-outline-primary {
  color: var(--pjudicial-primary);
  border-color: var(--pjudicial-primary);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Efecto hover para botón outline */
.btn-outline-primary:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background-color: var(--pjudicial-primary);
  transition: width 0.3s ease;
  z-index: -1;
}

.btn-outline-primary:hover {
  background-color: transparent;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-outline-primary:hover:after {
  width: 100%;
}

/* 
  =============================================
  TARJETAS DE MATERIAL
  Estilos para las tarjetas de libros, videos y boletines
  =============================================
*/
        .material-card {
            border: none;
            border-radius: 8px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            transition: all 0.3s ease;
            height: 100%;
            display: flex;
            flex-direction: column;
            border-left: 4px solid var(--pjudicial-primary);
            overflow: hidden;
        }

        .material-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }

        .card-img-container {
            position: relative;
            overflow: hidden;
        }

        .card-img-container img {
            width: 100%;
            height: 200px;
            object-fit: cover;
            transition: transform 0.3s ease;
        }

        .material-card:hover .card-img-container img {
            transform: scale(1.05);
        }

        .video-container {
            position: relative;
            padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
            height: 0;
            overflow: hidden;
        }

        .video-container iframe {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: none;
        }

        .material-icon {
            font-size: 1.5rem;
            color: white;
            background-color: rgba(0, 0, 0, 0.7);
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            position: absolute;
            top: 10px;
            right: 10px;
            z-index: 2;
        }

        .material-card:hover .material-icon {
            transform: scale(1.1);
            background-color: var(--pjudicial-primary);
        }

        .video-icon {
            background-color: rgba(0, 85, 140, 0.7);
        }

        .bulletin-icon {
            background-color: rgba(212, 175, 55, 0.7);
        }

        .material-badge {
            font-size: 0.75rem;
            font-weight: 600;
            letter-spacing: 0.5px;
            padding: 0.35rem 0.75rem;
            border-radius: 20px;
            transition: all 0.3s ease;
            position: absolute;
            bottom: 10px;
            left: 10px;
            z-index: 2;
        }

        .book-badge {
            background-color: rgba(158, 31, 32, 0.9);
            color: white;
        }

        .video-badge {
            background-color: rgba(0, 85, 140, 0.9);
            color: white;
        }

        .bulletin-badge {
            background-color: rgba(212, 175, 55, 0.9);
            color: white;
        }

        .card-body {
            display: flex;
            flex-direction: column;
            flex-grow: 1;
        }

        /* Contenedor para AnyFlip */
        .anyflip-container {
            position: relative;
            padding-bottom: 141.42%; /* Relación 1:√2 (típica para documentos A4/letter) */
            height: 0;
            overflow: hidden;
            background: #f5f5f5; /* Fondo gris claro para mientras carga */
        }

        .anyflip-iframe {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: none;
        }      
        
      /* Estilos personalizados para el modal */
      #pdfModal .modal-content {
          overflow: hidden; /* Elimina cualquier scroll */
          border-radius: 0.5rem;
      }

      #pdfModal .modal-header,
      #pdfModal .modal-footer {
          padding: 0.5rem 1rem; /* Espaciado mínimo */
          border: none;
      }

      #pdfModal .modal-body {
          line-height: 0; /* Elimina espacio extra en el contenedor */
      }

/* 
  =============================================
  FOOTER
  Estilos para el pie de página
  =============================================
*/
footer {
  background-color: var(--pjudicial-dark);
  color: white;
  padding: 3rem 0;
  position: relative;
  margin-top: auto;
}

/* Borde superior decorativo */
footer:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--pjudicial-primary), var(--pjudicial-secondary));
}

/* Enlaces del footer */
.footer-link {
  color: #aaa;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.footer-link:hover {
  color: white;
}

.footer-link:hover:after {
  width: 100%;
}

/* Iconos sociales */
.social-icon {
  color: white;
  font-size: 1.25rem;
  margin-right: 1rem;
  transition: all 0.3s ease;
  display: inline-block;
}

.social-icon:hover {
  color: var(--pjudicial-primary);
  transform: translateY(-3px) scale(1.1);
}

/* 
  =============================================
  PAGINACIÓN
  Estilos para la paginación de resultados
  =============================================
*/
.page-item .page-link {
  color: var(--pjudicial-primary);
  border: 1px solid #dee2e6;
  transition: all 0.3s ease;
}

.page-item:hover .page-link {
  background-color: rgba(158, 31, 32, 0.1);
  color: var(--pjudicial-primary);
  transform: translateY(-2px);
}

.page-item.active .page-link {
  background-color: var(--pjudicial-primary);
  border-color: var(--pjudicial-primary);
  color: white;
  box-shadow: 0 4px 8px rgba(158, 31, 32, 0.2);
}

.page-item.disabled .page-link {
  color: #6c757d;
}

/* 
  =============================================
  EFECTOS ESPECIALES
  Efectos visuales reutilizables
  =============================================
*/

/* Efecto de onda al hacer clic */
.wave-effect {
  position: relative;
  overflow: hidden;
}

.wave-effect:after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.wave-effect:hover:after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% { transform: scale(0, 0); opacity: 0.5; }
  100% { transform: scale(20, 20); opacity: 0; }
}

/* Efecto de revelado al hacer scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Efecto para items de contacto */
.contact-item {
  transition: all 0.3s ease;
  padding-left: 10px;
  border-left: 2px solid transparent;
}

.contact-item:hover {
  padding-left: 15px;
  border-left: 2px solid var(--pjudicial-primary);
}

/* 
  =============================================
  PÁGINA DE UBICACIÓN
  Estilos específicos para la página de ubicación
  =============================================
*/

/* Contenedor de detalles de ubicación */
.location-details-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Tarjetas de detalle de ubicación */
.location-detail-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--pjudicial-primary);
}

.location-detail-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--pjudicial-secondary);
}

/* Iconos de detalles */
.detail-icon {
  background: linear-gradient(135deg, var(--pjudicial-primary), var(--pjudicial-secondary));
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-right: 1.25rem;
  flex-shrink: 0;
}

.detail-content {
  flex: 1;
}

.detail-title {
  color: var(--pjudicial-primary);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.detail-text {
  color: var(--pjudicial-dark);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

/* Sección de mapa e información */
.bg-light {
  background-color: var(--pjudicial-light) !important;
}

.section-title {
  font-size: 2.2rem;
  color: var(--pjudicial-primary);
  margin-bottom: 0.5rem;
  font-weight: 700;
  position: relative;
  display: inline-block;
}

.section-subtitle {
  color: var(--pjudicial-dark);
  font-size: 1.1rem;
  opacity: 0.8;
  margin-bottom: 1.5rem;
}

.divider {
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--pjudicial-primary));
  margin: 1rem auto;
}

/* Tarjetas de ubicación */
.location-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  border: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.location-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Encabezado de tarjetas */
.card-header.bg-primary {
  background-color: var(--pjudicial-primary) !important;
  padding: 1.25rem 1.5rem;
}

.card-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
}

.card-header i {
  font-size: 1.2rem;
}

.card-body {
  padding: 2rem;
  flex: 1;
}

/* Contenedor del mapa */
.map-iframe-container {
  border-radius: 0 0 10px 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* 
  =============================================
  PESTAÑAS DE INFORMACIÓN
  Estilos para el sistema de pestañas en ubicación
  =============================================
*/
.nav-tabs {
  border-bottom: 2px solid #dee2e6;
  padding: 0 1rem;
  margin-top: 1rem;
}

.nav-tabs .nav-link {
  color: var(--pjudicial-dark);
  border: none;
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  border-radius: 0;
  position: relative;
  margin-bottom: -2px;
}

.nav-tabs .nav-link:hover {
  color: var(--pjudicial-primary);
  border-color: transparent;
}

.nav-tabs .nav-link.active {
  color: var(--pjudicial-primary);
  background-color: transparent;
  border: none;
  border-bottom: 3px solid var(--pjudicial-primary);
  font-weight: 600;
}

.nav-tabs .nav-link i {
  margin-right: 0.5rem;
}

.tab-content {
  min-height: 200px;
}

/* Lista de información */
.info-list {
  padding-left: 1.5rem;
  margin: 0;
}

.info-list li {
  margin-bottom: 0.5rem;
  position: relative;
}

/* 
  =============================================
  MEDIA QUERIES
  Estilos responsivos para diferentes tamaños de pantalla
  =============================================
*/
@media (max-width: 992px) {
  .location-card {
    margin-bottom: 1.5rem;
  }

  .section-title {
    font-size: 1.8rem;
  }
}

@media (max-width: 768px) {
  .location-details-container {
    grid-template-columns: 1fr;
  }

  .location-detail-card {
    padding: 1.25rem;
  }

  .nav-tabs .nav-link {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  .nav-tabs .nav-link i {
    margin-right: 0.3rem;
  }
}


/* =============================================
   FORMULARIO DE BÚSQUEDA RESPONSIVE
   ============================================= */

.search-form-container {
    width: 100%;
    margin-bottom: 1rem;
}

/* Estilos para pantallas pequeñas */
@media (max-width: 768px) {
    .search-hero {
        height: auto;
        padding: 2rem 0;
    }
    
    .search-container {
        padding: 1.5rem;
    }
    
    .search-form-container .form-control,
    .search-form-container .form-select,
    .search-form-container .btn {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    .search-form-container .btn {
        padding: 0.5rem;
    }
    
    .search-form-container .btn i {
        margin-right: 0;
    }
}

/* Estilos para pantallas muy pequeñas */
@media (max-width: 576px) {
    .search-container {
        padding: 1rem;
    }
    
    .search-form-container .col-6 {
        width: 50%;
    }
    
    .search-form-container .btn {
        font-size: 0.9rem;
    }
}

/* ============================================= PÁGINA DE CONTACTO Estilos específicos para la página de contacto ============================================= */

/* Hero section de contacto */
.contact-hero {
    background: linear-gradient(135deg, rgba(158, 31, 32, 0.8) 0%, rgba(0, 85, 140, 0.8) 100%), url('../../imagen/fachada_corte.jpeg') center/cover no-repeat;
    padding: 100px 0;
    position: relative;
}

.contact-container {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 2.5rem;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Contenedor de detalles de contacto */
.contact-details-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Tarjetas de detalle de contacto */
.contact-detail-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--pjudicial-primary);
}

.contact-detail-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--pjudicial-secondary);
}

/* Tarjeta del formulario */
.contact-form-card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.contact-form-card:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
}

/* Estilos para el formulario */
#contactForm label {
    font-weight: 500;
    color: var(--pjudicial-dark);
    margin-bottom: 0.5rem;
}

#contactForm .form-control, 
#contactForm .form-select {
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

#contactForm .form-control:focus, 
#contactForm .form-select:focus {
    border-color: var(--pjudicial-primary);
    box-shadow: 0 0 0 0.25rem rgba(158, 31, 32, 0.25);
}

/* Acordeón de preguntas frecuentes */
.accordion-button {
    font-weight: 500;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.accordion-button:not(.collapsed) {
    background-color: rgba(158, 31, 32, 0.05);
    color: var(--pjudicial-primary);
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(158, 31, 32, 0.25);
    border-color: var(--pjudicial-primary);
}

.accordion-body {
    padding: 1.25rem;
    background-color: rgba(248, 249, 250, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    .contact-details-container {
        grid-template-columns: 1fr;
    }
    
    .contact-detail-card {
        padding: 1.25rem;
    }
    
    .accordion-button {
        padding: 1rem;
        font-size: 0.95rem;
    }
}




/* Estilos para SweetAlert2 con tema judicial peruano */
.judicial-popup {
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(156, 39, 39, 0.3) !important;
}

.judicial-title {
    color: #9E1F20 !important;
    font-weight: 700 !important;
    font-size: 1.5rem !important;
    text-shadow: 1px 1px 2px rgba(92, 31, 26, 0.1) !important;
}

.judicial-icon {
    color: #9E1F20 !important;
}

.judicial-confirm-btn {
    background-color: #9E1F20 !important;
    color: white !important;
    border-radius: 4px !important;
    padding: 8px 24px !important;
    font-weight: 600 !important;
    transition: all 0.3s !important;
    border: none !important;
}

.judicial-confirm-btn:hover {
    background-color: #9E1F20 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(156, 39, 39, 0.4) !important;
}

.judicial-confirm-btn:active {
    transform: translateY(0) !important;
}