/* ========================================
   HISTORIAS PAGE - CLEAN STYLES
   ======================================== */

/* Hero Section */
.hero-historias {
    height: 400px;
    background: linear-gradient(135deg, #1C3A4E 0%, #009E5E 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-overlay {
    text-align: center;
    color: #FFFFFF;
    z-index: 2;
    padding: 0 20px;
}

.hero-historias h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-historias p {
    font-size: 20px;
    opacity: 0.95;
    font-weight: 300;
}

/* ========================================
   FILTROS SECTION
   ======================================== */
.filtros-section {
    padding: 40px 0;
    background: #FFFFFF;
    border-bottom: 1px solid #e0e0e0;
}

.filtros-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

/* Filtro de búsqueda */
.filtro-busqueda {
    position: relative;
}

.filtro-busqueda i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 16px;
    pointer-events: none;
}

.filtro-busqueda input {
    width: 100%;
    padding: 14px 18px 14px 48px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #FFFFFF;
}

.filtro-busqueda input:focus {
    outline: none;
    border-color: #1C3A4E;
    box-shadow: 0 0 0 4px rgba(28, 58, 78, 0.1);
}

.filtro-busqueda input::placeholder {
    color: #999;
}

/* Selectores de filtro */
.filtro-tipo select,
.filtro-ordenar select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #FFFFFF;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.filtro-tipo select:focus,
.filtro-ordenar select:focus {
    outline: none;
    border-color: #1C3A4E;
    box-shadow: 0 0 0 4px rgba(28, 58, 78, 0.1);
}

.filtro-tipo select:hover,
.filtro-ordenar select:hover {
    border-color: #1C3A4E;
}

/* Resultados info */
.resultados-info {
    text-align: center;
}

.total-historias {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: #F4F4F4;
    border-radius: 30px;
    font-size: 16px;
    color: #3E3E3E;
    font-weight: 500;
}

.total-historias i {
    color: #1C3A4E;
    font-size: 18px;
}

.total-historias span {
    font-weight: 700;
    color: #009E5E;
    font-size: 18px;
}

/* ========================================
   GRID DE HISTORIAS
   ======================================== */
.historias-grid-section {
    padding: 60px 0 80px;
    background: #F4F4F4;
    min-height: 500px;
}

.historias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 35px;
}

/* Historia Card */
.historia-card {
    background: #FFFFFF;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.historia-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Badge de tipo */
.historia-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 10;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.historia-card[data-tipo="imagen"] .historia-badge {
    background: rgba(28, 58, 78, 0.95);
    color: #FFFFFF;
}

.historia-card[data-tipo="video"] .historia-badge {
    background: rgba(0, 158, 94, 0.95);
    color: #FFFFFF;
}

.historia-badge i {
    font-size: 14px;
}

/* Media Container */
.historia-media {
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
    background: #F4F4F4;
}

.historia-media img,
.historia-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.historia-card:hover .historia-media img,
.historia-card:hover .historia-media video {
    transform: scale(1.08);
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    pointer-events: none;
}

.video-overlay i {
    font-size: 70px;
    color: #FFFFFF;
    opacity: 0.9;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.historia-card:hover .video-overlay {
    background: rgba(0, 0, 0, 0.4);
}

/* Contenido */
.historia-content {
    padding: 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.historia-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1C3A4E;
    margin-bottom: 15px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.historia-descripcion {
    font-size: 14px;
    color: #666;
    line-height: 1.7;
    margin-bottom: 20px;
    flex: 1;
}

/* Footer del card */
.historia-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
}

.historia-fecha {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

.historia-fecha i {
    color: #009E5E;
    font-size: 15px;
}

/* Botón leer más */
.btn-leer-mas {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    background: #1C3A4E;
    color: #FFFFFF;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-leer-mas:hover {
    background: #009E5E;
    transform: translateX(5px);
}

.btn-leer-mas i {
    font-size: 13px;
    transition: transform 0.3s ease;
}

.btn-leer-mas:hover i {
    transform: translateX(4px);
}

/* ========================================
   NO RESULTADOS
   ======================================== */
.no-resultados {
    text-align: center;
    padding: 100px 20px;
}

.no-resultados i {
    font-size: 90px;
    color: #6c757d;
    opacity: 0.4;
    margin-bottom: 25px;
}

.no-resultados h3 {
    font-size: 30px;
    font-weight: 600;
    color: #3E3E3E;
    margin-bottom: 12px;
}

.no-resultados p {
    font-size: 17px;
    color: #666;
}

/* ========================================
   MODAL
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

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

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: #FFFFFF;
    border-radius: 20px;
    max-width: 900px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 100000;
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Custom scrollbar para el modal */
.modal-content::-webkit-scrollbar {
    width: 10px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 20px 20px 0;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #1C3A4E;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #009E5E;
}

/* Botón cerrar */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: #FFFFFF;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #1C3A4E;
    transition: all 0.3s ease;
    z-index: 100001;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal-close:hover {
    background: #C1272D;
    color: #FFFFFF;
    transform: rotate(90deg) scale(1.1);
}

/* Modal Body */
.modal-body {
    display: flex;
    flex-direction: column;
}

.modal-media {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    background: #F4F4F4;
}

.modal-media img,
.modal-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modal-info {
    padding: 45px;
}

.modal-fecha {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #F4F4F4;
    border-radius: 20px;
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    font-weight: 500;
}

.modal-fecha i {
    color: #009E5E;
}

.modal-info h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1C3A4E;
    margin-bottom: 25px;
    line-height: 1.3;
}

.modal-info p {
    font-size: 15px;
    line-height: 1.8;
    color: #3E3E3E;
    text-align: justify;
    margin-bottom: 35px;
}

/* Compartir */
.modal-compartir {
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.modal-compartir h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1C3A4E;
    margin-bottom: 18px;
}

.compartir-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-compartir {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-compartir.facebook {
    background: #1877f2;
}

.btn-compartir.twitter {
    background: #1da1f2;
}

.btn-compartir.whatsapp {
    background: #25d366;
}

.btn-compartir.link {
    background: #1C3A4E;
}

.btn-compartir:hover {
    transform: translateY(-6px) scale(1.08);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.btn-compartir:active {
    transform: translateY(-3px) scale(1.05);
}

/* ========================================
   CTA SECTION
   ======================================== */
.cta-historia-section {
    padding: 90px 0;
    background: linear-gradient(135deg, #1C3A4E 0%, #009E5E 100%);
}

.cta-content {
    text-align: center;
    color: #FFFFFF;
}

.cta-content h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 20px;
}

.cta-content p {
    font-size: 18px;
    margin-bottom: 40px;
    opacity: 0.95;
    font-weight: 300;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 45px;
    background: #F26522;
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-cta:hover {
    background: #C1272D;
    color: #FFFFFF;
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.btn-cta i {
    font-size: 20px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 992px) {
    .filtros-container {
        grid-template-columns: 1fr 1fr;
    }

    .filtro-busqueda {
        grid-column: 1 / -1;
    }

    .historias-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .hero-historias {
        height: 350px;
    }

    .hero-historias h1 {
        font-size: 38px;
    }

    .hero-historias p {
        font-size: 18px;
    }

    .filtros-container {
        grid-template-columns: 1fr;
    }

    .historias-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 96%;
        max-height: 92vh;
    }

    .modal-info {
        padding: 30px;
    }

    .modal-info h2 {
        font-size: 26px;
    }

    .modal-media {
        max-height: 350px;
    }

    .cta-content h2 {
        font-size: 32px;
    }

    .cta-content p {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .hero-historias {
        height: 280px;
    }

    .hero-historias h1 {
        font-size: 30px;
    }

    .hero-historias p {
        font-size: 16px;
    }

    .historia-media {
        height: 260px;
    }

    .historia-content {
        padding: 22px;
    }

    .modal-info {
        padding: 25px;
    }

    .modal-info h2 {
        font-size: 22px;
    }

    .modal-info p {
        font-size: 15px;
    }

    .modal-media {
        max-height: 280px;
    }

    .btn-cta {
        padding: 16px 35px;
        font-size: 16px;
    }

    .compartir-buttons {
        justify-content: center;
    }

    .cta-content h2 {
        font-size: 26px;
    }

    .cta-content p {
        font-size: 16px;
    }
}
