/* ========================================
   ESTILOS PARA SECCIÓN DE NOTICIAS JURÍDICAS
   ======================================== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    min-height: 100vh;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Container for limiting content width */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main Content Wrapper - grows to push footer down */
.main-content {
    flex: 1;
    padding-top: 106px; /* Compensar header fijo (70px + 18px + 18px) */
}

/* Header y navegación */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 18px;
    padding-bottom: 18px;
}

.nav {
    position: relative;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 56px;
    width: auto;
    display: block;
}

.logo-text {
    color: #1a365d;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #1a365d;
}

.btn-login {
    background: #1a365d;
    color: white;
    border: none;
    padding: 10px 28px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-login:hover {
    background: #2d5a87;
    transform: translateY(-2px);
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #4a5568;
}

/* Main Content */
.main-content {
    padding-top: 106px; /* Compensar header fijo (70px + 18px + 18px) */
}

/* Hero Section */
.noticias-hero {
    background: linear-gradient(135deg, #1a365d 0%, #2d3748 100%);
    color: white;
    padding: 120px 0 80px;
    text-align: center;
}

.noticias-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    font-family: 'Libre Baskerville', serif;
}

.noticias-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Sección principal de noticias */
.noticias-seccion {
    background: #f7fafc;
    padding: 60px 0;
}

/* Controles de filtrado */
.controles-noticias {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.controles-superiores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.controles-inferiores {
    display: flex;
    gap: 1rem;
    align-items: end;
}

/* Grupos de control */
.control-grupo {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-grupo label {
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.control-grupo select,
.control-grupo input {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #ffffff;
    transition: all 0.3s ease;
}

.control-grupo select:focus,
.control-grupo input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Buscador */
.buscador-grupo {
    flex: 1;
    min-width: 300px;
}

.buscador-grupo input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 18px;
    transition: all 0.3s ease;
}

.buscador-grupo input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Estadísticas */
.estadisticas {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.estadistica {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4a5568;
    font-weight: 500;
}

.estadistica i {
    color: #1a365d;
    font-size: 1.1rem;
}

/* Loading */
.loading-spinner {
    display: none;
    text-align: center;
    padding: 3rem;
}

.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #1a365d;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estado sin noticias */
.no-noticias {
    text-align: center;
    padding: 3rem;
    color: #4a5568;
}

.no-noticias i {
    font-size: 3rem;
    color: #e2e8f0;
    margin-bottom: 1rem;
}

.no-noticias h3 {
    margin: 0 0 0.5rem 0;
    color: #1a202c;
}

.no-noticias p {
    margin: 0;
    font-size: 0.95rem;
}

/* Contenedor de noticias */
.noticias-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Tarjetas de noticias */
.noticia {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

.noticia:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.noticia-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.noticia-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.noticia-fuente {
    background: #1a365d;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.noticia-fecha {
    color: #718096;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.noticia-categoria {
    background: #e2e8f0;
    color: #4a5568;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.noticia-titulo {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a202c;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.noticia-titulo a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
}

.noticia-titulo a:hover {
    color: #007bff;
}

.noticia-titulo a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

.noticia-titulo a:hover {
    color: #007bff;
}

.noticia-contenido {
    padding: 1.5rem;
}

.noticia-resumen {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.noticia-resumen p {
    margin: 0;
    line-height: 1.6;
    color: #4a5568;
    /* Removido el corte de líneas para mostrar resumen completo */
}

.noticia-etiquetas {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.etiqueta {
    background: #f7fafc;
    color: #4a5568;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.noticia-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f7fafc;
}

.btn-ver-mas,
.btn-imagen {
    background: #1a365d;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-ver-mas:hover,
.btn-imagen:hover {
    background: #2d3748;
    transform: translateY(-1px);
}

/* Paginación */
.paginacion {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.btn-pagina {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    color: #4a5568;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-pagina:hover:not(:disabled) {
    border-color: #007bff;
    color: #007bff;
}

.btn-pagina:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-pagina.activa {
    background: #1a365d;
    color: white;
    border-color: #1a365d;
}

/* Estilos para los puntos suspensivos en paginación */
.paginacion-ellipsis {
    padding: 0.75rem 0.5rem;
    color: #718096;
    font-weight: 500;
    user-select: none;
}

/* Mejorar el espaciado de la paginación para más botones */
.paginacion {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn-pagina {
    min-width: 2.5rem;
    justify-content: center;
}

/* Mensajes de error y estado vacío */
.error-mensaje,
.no-noticias {
    text-align: center;
    padding: 3rem 1rem;
    color: #718096;
}

.error-mensaje i,
.no-noticias i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.error-mensaje h3,
.no-noticias h3 {
    margin-bottom: 0.5rem;
    color: #1a202c;
}

.btn-reintentar {
    background: #007bff;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.btn-reintentar:hover {
    background: #0056b3;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .noticias-hero h1 {
        font-size: 2rem;
    }
    
    .noticias-hero p {
        font-size: 1rem;
    }
    
    .controles-superiores {
        grid-template-columns: 1fr;
    }
    
    .controles-inferiores {
        flex-direction: column;
        align-items: stretch;
    }
    
    .buscador-grupo {
        min-width: auto;
    }
    
    .estadisticas {
        flex-direction: column;
        gap: 1rem;
    }
    
    .noticias-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .noticia-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .noticia-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .btn-ver-mas,
    .btn-imagen {
        justify-content: center;
    }
    
    .paginacion {
        flex-wrap: wrap;
    }
}

/* Footer */
.footer {
    background: #2d3748;
    color: white;
    padding: 3rem 0 1rem;
    position: relative;
    z-index: 1;
}

.footer-clean-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer h4 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer ul li a:hover {
    color: white;
}

.footer-bottom-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-socials {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-socials a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.footer-socials a:hover {
    color: white;
}

@media (max-width: 768px) {
    .footer-bottom-flex {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   ESTILOS DEL WIDGET DE CHAT
   ======================================== */

/* Chat Widget Styles */
.rj-chat-bubble {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 9999;
  background: #1a365d;
  color: #fff;
  border-radius: 50px;
  box-shadow: 0 8px 32px rgba(44,62,80,0.18);
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 56px;
  height: 56px;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.2s, transform 0.2s;
  animation: rj-bounce-in 0.7s cubic-bezier(.68,-0.55,.27,1.55);
}

.rj-chat-bubble:hover {
  box-shadow: 0 12px 36px rgba(44,62,80,0.22);
  background: #223e6d;
  transform: scale(1.08);
}

@keyframes rj-bounce-in {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.rj-chat-bubble .rj-chat-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  margin: 0;
}

.rj-chat-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #ff3b3b;
  color: #fff;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  box-shadow: 0 2px 8px rgba(44,62,80,0.18);
  display: none;
}

.rj-chat-modal {
  position: fixed;
  right: 24px;
  bottom: 100px;
  width: 350px;
  max-width: 95vw;
  height: 420px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(44,62,80,0.18);
  border: 1.5px solid #e5e7eb;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', Arial, sans-serif;
}

@media (max-width: 500px) {
  .rj-chat-modal {
    right: 2vw;
    width: 96vw;
    height: 60vh;
    min-width: 0;
    border-radius: 12px;
    padding: 0;
  }
  .rj-chat-bubble {
    right: 2vw;
    bottom: 2vw;
    font-size: 1rem;
    height: 48px;
    width: 48px;
    padding: 0;
  }
}

.rj-chat-close {
  background: none;
  border: none;
  color: #bbb;
  font-size: 1.3rem;
  cursor: pointer;
  margin-left: auto;
  margin-right: 6px;
  margin-top: 6px;
  transition: color 0.2s;
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 2;
  padding: 2px 6px;
  border-radius: 50%;
}

.rj-chat-close:hover {
  color: #23272f;
  background: #f2f2f2;
}

.rj-chat-body {
  flex: 1;
  background: #fff;
  padding: 18px 12px 12px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 32px;
}

.rj-chat-msg {
  max-width: 85%;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 1.02rem;
  line-height: 1.5;
  word-break: break-word;
  box-shadow: 0 2px 8px rgba(44,62,80,0.06);
  margin-bottom: 2px;
}

.rj-chat-msg.user {
  align-self: flex-end;
  background: #e2fbe6;
  color: #23272f;
  border-bottom-right-radius: 4px;
}

.rj-chat-msg.assistant {
  align-self: flex-start;
  background: #fff;
  color: #23272f;
  border-bottom-left-radius: 4px;
}

.rj-chat-footer {
  padding: 12px 14px 14px 14px;
  background: #fff;
  display: flex;
  gap: 8px;
  border-top: 1px solid #e5e7eb;
}

.rj-chat-input {
  flex: 1;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 1rem;
  outline: none;
  transition: border 0.2s;
}

.rj-chat-input:focus {
  border-color: #1a365d;
}

.rj-chat-send {
  background: #1a365d;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0 18px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.rj-chat-send:disabled {
  background: #b2e9c7;
  cursor: not-allowed;
} 