/* ===== RESET BÁSICO Y VARIABLES GLOBALES ===== */
:root {
    --primary-color: #003366; /* Azul institucional oscuro */
    --secondary-color: #D4AF37; /* Dorado para acentos */
    --accent-color: #CE1126; /* Rojo para llamadas a la acción */
    --text-color: #333;
    --bg-color: #f4f7f6;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* ===== ESTILOS DEL ENCABEZADO ===== */
.main-header .top-bar {
    height: 5px;
    background: linear-gradient(to right, #FFD100, #0038A8, #CE1126); /* Bandera de Venezuela */
}

.main-header .main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    /* Transición para el cambio de padding */
    padding: 1rem 5%;
    transition: padding 0.3s ease-in-out;
}

.main-header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    /* Transición para el cambio de tamaño de fuente */
    transition: font-size 0.3s ease-in-out;
}

.main-header .logo-img {
    height: 60px; /* Altura base del logo */
    display: block; /* Para evitar espacios extra debajo de la imagen */
    transition: height 0.3s ease-in-out; /* Transición para la altura */
}

.main-header .nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-header .nav-links a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    transition: color 0.3s ease;
}

.main-header .nav-links a:hover {
    color: var(--secondary-color);
}

.cta-button {
    background-color: var(--primary-color);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 51, 102, 0.3);
}

/* ===== ESTILOS DE LA SECCIÓN HERO ===== */
.hero {
    color: white;
    height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden; /* Oculta lo que se salga del contenedor */
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Lo movemos detrás del contenido del hero */
}

.hero .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: opacity 1.5s ease-in-out; /* Transición suave de opacidad */
}

.hero .slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 1), rgba(109, 109, 109, 0));
    z-index: 1; /* Se coloca sobre la imagen de fondo del slide */
}

.hero .slide.active {
    opacity: 1;
}

.hero-content {
    max-width: 800px;
    padding: 0 2rem;
    position: relative;
    z-index: 2; /* Se coloca sobre el gradiente */
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-button-hero {
    background-color: var(--accent-color);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button-hero:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(206, 17, 38, 0.4);
}

/* Estilos para las flechas y puntos del carrusel */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    z-index: 3; /* Por encima del contenido */
    transition: background-color 0.3s ease;
}

.carousel-arrow:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.carousel-arrow.prev {
    left: 1rem;
    border-radius: 0 5px 5px 0;
}

.carousel-arrow.next {
    right: 1rem;
    border-radius: 5px 0 0 5px;
}

.carousel-dots {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 3;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active,
.dot:hover {
    background-color: white;
}

/* ===== ESTILOS DE LA SECCIÓN "QUIÉNES SOMOS" ===== */
.about-section {
    padding: 5rem 5%;
    background-color: var(--card-bg-color);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.about-text h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.about-text h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.about-text ul {
    list-style-position: inside;
    padding-left: 0;
}

.about-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* ===== ESTILOS DE LA SECCIÓN DE NOTICIAS ===== */
.news-section {
    padding: 5rem 5%;
    background-color: var(--bg-color);
}

.news-section h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 3rem;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.news-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.news-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-card-content {
    padding: 1.5rem;
}

.news-card-content h3 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

/* ===== ESTILOS DE LA PAGINACIÓN ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 3rem;
    gap: 0.5rem;
}

.pagination-button {
    border: 1px solid var(--primary-color);
    background-color: #fff;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    border-radius: 5px;
    font-weight: 600;
}

.pagination-button:hover,
.pagination-button.active {
    background-color: var(--primary-color);
    color: #fff;
}

.pagination-button:disabled {
    background-color: #e9ecef;
    border-color: #dee2e6;
    cursor: not-allowed;
}

/* ===== ESTILOS DEL ENCABEZADO CUANDO SE HACE SCROLL ===== */
.main-header.scrolled .main-nav {
    /* Reducimos el padding vertical para hacerlo más compacto */
    padding: 0.5rem 5%;
}

.main-header.scrolled .logo {
    /* Reducimos el tamaño del logo */
    font-size: 1.3rem;
}

.main-header.scrolled .logo-img {
    /* Reducimos la altura del logo */
    height: 32px;
}

/* ===== OTRAS SECCIONES Y PIE DE PÁGINA ===== */
.placeholder-section {
    padding: 4rem 5%;
    text-align: center;
    min-height: 300px;
    border-bottom: 1px solid #ddd;
}

.main-footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem;
}

/* ===== ESTILOS DE LA SECCIÓN DE REGISTRO ===== */
.registration-section {
    background-color: #fff;
    padding: 5rem 5%;
    text-align: center;
}

.registration-section .container {
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}

.registration-section h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 1rem;
}

.registration-section p {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1.1rem;
    color: #666;
}

.registration-form fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.registration-form legend {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    padding: 0 0.5rem;
    margin-left: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 51, 102, 0.2);
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.checkbox-group input {
    margin-right: 0.7rem;
}

.submit-button {
    display: block;
    width: 100%;
    padding: 1rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

.submit-button:hover {
    background-color: #a50f1f; /* Un rojo más oscuro */
    transform: translateY(-2px);
}

/* ESTILOS PARA MENSAJES DE RESPUESTA DEL FORMULARIO */
.form-message {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.form-message.success {
    background-color: #d4edda;
    color: #155724;
}

.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
}

/* ===== ESTILOS DEL SPINNER DE CARGA ===== */
.loading-spinner {
    border: 5px solid rgba(0, 0, 0, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 3rem auto; /* Centrar el spinner en su contenedor */
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ===== ESTILOS DEL MODAL DE NOTICIAS ===== */
.modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--card-bg-color);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 700px;
    border-radius: 8px;
    position: relative;
    animation: fadeInModal 0.3s;
}

.close-button {
    color: var(--subtle-text-color);
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: var(--accent-color);
}

.modal-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.modal-text-content #modal-title {
    color: var(--primary-color);
}

.modal-text-content #modal-date {
    color: var(--subtle-text-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ===== ESTILOS DEL ASISTENTE DE REGISTRO (WIZARD) ===== */
.wizard-progress {
    position: relative;
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    counter-reset: step;
}

.wizard-progress::before, .wizard-progress-bar {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    width: 100%;
    background-color: #e0e0e0;
    z-index: -1;
}

.wizard-progress-bar {
    width: 0;
    background-color: var(--primary-color);
    transition: width 0.4s ease;
}

.wizard-step {
    width: 40px;
    height: 40px;
    background-color: #fff;
    border: 3px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #e0e0e0;
    transition: all 0.4s ease;
    position: relative;
}

.wizard-step::after {
    content: attr(data-step-name);
    position: absolute;
    top: 45px;
    font-size: 0.8rem;
    color: #888;
    width: 100px;
    text-align: center;
}

.wizard-step.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.wizard-step.completed {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.wizard-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.form-group input.invalid,
.form-group select.invalid,
.form-group textarea.invalid {
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(206, 17, 38, 0.3);
}

/* ===== ESTILOS DE LA PÁGINA DE DIRECTORIO ===== */
.directory-section {
    background-color: #fff;
    padding: 5rem 5%;
}

.directory-section .container {
    max-width: 1200px;
    margin: 0 auto;
}

.directory-section h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.directory-section p {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 1.1rem;
    color: #666;
}

.filters-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.filter-group select {
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    min-width: 250px;
}

.filter-group.search-group {
    flex-grow: 1; /* Permite que el campo de búsqueda crezca */
    min-width: 300px;
}

.filter-group input[type="search"] {
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    width: 100%;
}

.clear-filters-button {
    align-self: flex-end; /* Se alinea con la parte inferior de los otros filtros */
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--accent-color);
    background-color: transparent;
    color: var(--accent-color);
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    height: fit-content;
    margin-bottom: 1px; /* Pequeño ajuste para alinear perfectamente */
}

.clear-filters-button:hover {
    background-color: var(--accent-color);
    color: white;
}

.company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.company-card {
    background-color: var(--bg-color);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.3s ease;
    cursor: pointer;
}

.company-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.company-card h3 { color: var(--primary-color); margin-bottom: 0.5rem; }
.company-card p { font-size: 0.9rem; color: #666; margin-bottom: 0.5rem; }
.company-card .company-description { font-size: 1rem; color: var(--text-color); margin-top: 1rem; }
.no-results { text-align: center; grid-column: 1 / -1; font-size: 1.2rem; padding: 2rem; }

/* ===== ESTILOS DEL MODAL DE DETALLE DE EMPRESA ===== */
.modal-content.large {
    max-width: 800px;
}

#modal-company-name {
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.modal-company-rif {
    color: #777;
    font-weight: bold;
    margin-bottom: 2rem;
    display: block;
}

.modal-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.modal-detail-section h3 {
    color: var(--primary-color);
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.modal-detail-section p {
    margin-bottom: 0.5rem;
}

/* ===== ESTILOS DEL PANEL DE ADMINISTRACIÓN ===== */
.admin-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.admin-container h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.admin-container h3 {
    color: var(--primary-color);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.admin-form {
    max-width: 400px;
    margin: 2rem auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.admin-table th, .admin-table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}

.admin-table th {
    background-color: var(--bg-color);
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    color: white;
    font-size: 0.8rem;
}

.action-btn.approve { background-color: #28a745; }
.action-btn.reject { background-color: var(--accent-color); }
.action-btn.view { background-color: var(--primary-color); }

.status-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
}

.status-badge.active_affiliate { background-color: #28a745; }
.status-badge.rejected { background-color: #6c757d; }
.status-badge.inactive { background-color: #ffc107; color: #333; }
