/**
 * Estilos del Modal de Noticias
 *
 * Estructura organizada:
 * 1. Variables y configuración global
 * 2. Estructura básica del modal
 * 3. Elementos decorativos
 * 4. Cabecera de artículo
 * 5. Cuerpo del artículo
 * 6. Pie del artículo
 * 7. Controles y componentes interactivos
 * 8. Animaciones
 * 9. Media queries para responsividad
 */

/* 1. Variables - Podría implementarse con CSS variables para mejor mantenimiento */
/* --color-primary: #006fdd;
   --color-secondary: #00c6ff;
   --color-text-dark: #222;
   --color-text-medium: #444;
   --color-text-light: #666;
   --border-radius-large: 24px;
   --transition-standard: 0.3s ease;
   --transition-fancy: 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); */

/* 2. Estructura básica del modal */
.modal-dialog {
    max-width: 900px;
    margin: 1.75rem auto;
}

.modal-content  {
    border: none;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    height: 90vh;
    overflow: hidden;
    position: relative;
}

/* Modal Container con Scroll */
.modal-container {
    height: 100%;
    overflow-y: auto;
    padding: 0;
    position: relative;
    scroll-behavior: smooth; /* Comportamiento de scroll suave */
    scrollbar-color: #006fdd #f1f1f1;
    scrollbar-width: thin;
    z-index: 1;
}

/* Estilizar scrollbar para navegadores webkit */
.modal-container::-webkit-scrollbar {
    width: 4px;
}

.modal-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.modal-container::-webkit-scrollbar-thumb {
    background: #006fdd;
    border-radius: 8px;
}


/* 4. Cabecera del artículo */
.article-header {
    background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
    border-bottom: 1px solid rgba(0, 111, 221, 0.1);
    padding: 60px 60px 30px;
    position: relative;
}

.header-meta {
    align-items: center;
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.header-meta.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.category-badge {
    background: linear-gradient(135deg, #006fdd 0%, #4c94ff 100%);
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0, 111, 221, 0.2);
    color: white;
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 6px 15px;
}

.article-date {
    color: #666;
    font-size: 0.9rem;
    padding-left: 20px;
    position: relative;
}

.article-date::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    content: '';
    height: 12px;
    left: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
}

.article-title {
    color: #222;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0;
    opacity: 0;
    padding-bottom: 30px;
    position: relative;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.article-title.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.article-title::after {
    background: linear-gradient(90deg, #006fdd, transparent);
    bottom: 15px;
    content: '';
    height: 4px;
    left: 0;
    position: absolute;
    width: 80px;
}

/* 5. Cuerpo del artículo */
.article-body {
    padding: 40px 60px;
    position: relative;
}

.article-content-wrapper {
    opacity: 0;
    position: relative;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.article-content-wrapper.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.article-decoration-element {
    background: #006fdd;
    border-radius: 50%;
    box-shadow: 0 0 0 5px rgba(0, 111, 221, 0.1);
    height: 15px;
    left: -30px;
    position: absolute;
    top: 10px;
    width: 15px;
}

.article-content {
    color: #444;
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content p:first-of-type {
    color: #333;
    font-size: 1.3rem;
    font-weight: 500;
    position: relative;
}

.article-content p:first-of-type::first-letter {
    color: #006fdd;
    float: left;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 0.8;
    margin-right: 8px;
}

.article-content h2 {
    color: #222;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    margin-top: 40px;
    padding-bottom: 10px;
    position: relative;
}

.article-content h2::after {
    background: linear-gradient(90deg, #006fdd, transparent);
    bottom: 0;
    content: '';
    height: 3px;
    left: 0;
    position: absolute;
    width: 50px;
}

.article-content blockquote {
    background: rgba(0, 111, 221, 0.03);
    border-left: 4px solid #006fdd;
    border-radius: 0 8px 8px 0;
    color: #555;
    font-style: italic;
    margin: 30px 0;
    padding: 20px 20px 20px 30px;
}

/* 6. Pie del artículo */
.article-footer {
    background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
    opacity: 0;
    padding: 30px 60px;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.article-footer.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* 7. Controles y componentes interactivos */
/* Barra de progreso de lectura */
.reading-progress-container {
    background: rgba(0, 0, 0, 0.05);
    height: 4px;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 10;
}

.reading-progress-bar {
    background: linear-gradient(90deg, #006fdd, #00c6ff);
    height: 100%;
    transition: width 0.1s ease;
    width: 0;
}

/* Botón de cierre */
.modal-close-btn {
    align-items: center;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    height: 40px;
    justify-content: center;
    position: absolute;
    right: 20px;
    top: 20px;
    transition: all 0.3s ease;
    width: 40px;
    z-index: 10;
}

.modal-close-btn:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    transform: rotate(90deg);
}

.modal-close-btn svg {
    fill: none;
    stroke: #333;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

/* Botón personalizado */
.btn-close-article {
    align-items: center;
    background: linear-gradient(135deg, #f0f0f0 0%, #e5e5e5 100%);
    border: none;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    color: #333;
    cursor: pointer;
    display: flex;
    font-size: 0.95rem;
    font-weight: 600;
    gap: 10px;
    justify-content: center;
    overflow: hidden;
    padding: 12px 24px;
    position: relative;
    transition: all 0.3s ease;
}

.btn-close-article:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.btn-icon {
    align-items: center;
    display: flex;
    justify-content: center;
}

.btn-icon svg {
    fill: none;
    stroke: #333;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

/* 8. Animaciones */
@keyframes highlightFade {
    0% {
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes modalClose {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.95) translateY(30px);
    }
}

/* Animaciones del modal */
.modal.fade .modal-dialog {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
}

.modal.show .modal-dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.modal-closing {
    animation: modalClose 0.5s forwards;
}

/* 9. Media queries padra responsividad */
@media (max-width: 992px) {
    .article-title {
        font-size: 2.5rem;
    }

    .article-header,
    .article-body,
    .article-footer {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .modal-dialog {
        height: 100dvh;
        height: 100vh; /* Fallback */
        margin: 0;
        max-width: 100%;
    }
    .modal-content {
        border-radius: 0;
        height: 100dvh;
        height: 100vh; /* Fallback */
        padding: 10px;
    }

    .article-title {
        font-size: 2rem;
    }


}

@media (max-width: 576px) {
    .article-title {
        font-size: 1.8rem;
    }

    .header-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .article-content p:first-of-type::first-letter {
        font-size: 2.5rem;
    }

    .article-header {
        padding-top: 40px;
    }

    .modal-close-btn {
        right: 10px;
        top: 10px;
    }

    iframe {
        width: 100% !important;
    }
}