/**
 * ESTILOS PARA PRODUCCIÓN - Sin inline styles
 * 
 * Este archivo contiene estilos que deben reemplazar
 * cualquier style="..." encontrado en HTML/JS
 * 
 * Uso: En producción, asegúrate de que todo elemento
 * use clases CSS en lugar de atributos style
 */

/* ===================================
   1. OVERLAY Y MODALES
   =================================== */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 999;
}

.overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 95%;
    padding: 30px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===================================
   2. LAZYLOAD - Placeholder
   =================================== */

.lazyload-placeholder {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===================================
   3. ACCESIBILIDAD - Estilos dinamicos
   =================================== */

.contrast-high {
    filter: contrast(1.5);
}

.font-large {
    font-size: 18px !important;
    line-height: 1.8;
}

.font-extra-large {
    font-size: 24px !important;
    line-height: 2;
}

.high-contrast-mode {
    background: #000;
    color: #fff;
}

.high-contrast-mode a {
    color: #ffff00;
    text-decoration: underline;
}

/* ===================================
   4. COOKIES BANNER - Notificación
   =================================== */

.cookies-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: #ffffff;
    color: #333;
    padding: 25px;
    z-index: 1000;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: slideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    max-width: 1240px;
    margin: 0 auto;
}

@keyframes slideUp {
    from {
        transform: translateY(120%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookies-banner.hidden {
    display: none;
}

.cookies-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    text-align: left;
}

.cookies-content {
    flex: 1;
    min-width: 300px;
}

.cookies-content h3 {
    margin: 0 0 10px 0;
    color: #004300;
    font-size: 1.2rem;
    font-weight: 700;
}

.cookies-content p {
    margin: 0;
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
}

.cookies-types {
    display: none; /* Simplificado para el banner */
}

.cookies-actions {
    display: flex;
    gap: 12px;
}

.cookies-actions button {
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-accept {
    background: #004300;
    color: #ffffff;
}

.btn-accept:hover {
    background: #f39c12; /* Naranja institucional para hover */
    border-color: #f39c12;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.btn-decline {
    background: #ffffff;
    color: #004300;
    border: 2px solid #004300 !important;
}

.btn-decline:hover {
    background: #fff5f5;
    color: #e74c3c;
    border-color: #e74c3c !important;
}

.privacy-link {
    color: #004300;
    text-decoration: underline;
    font-weight: 600;
}

/* Dropdowns removed - managed in style.css for consistency */

/* ===================================
   6. SEARCH - Búsqueda
   =================================== */

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 998;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.search-overlay.active {
    display: flex;
}

.search-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 70vh;
    overflow-y: auto;
}

/* ===================================
   7. SCROLLBARS - Personalizadas
   =================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ===================================
   8. RESPONSIVE - Media Queries
   =================================== */

@media (max-width: 768px) {
    .modal {
        width: 95%;
        padding: 20px;
    }

    .cookies-banner {
        padding: 15px 10px;
        font-size: 14px;
    }

    .dropdown-content {
        min-width: 150px;
    }

    .search-box {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 15px;
    }

    .font-large {
        font-size: 16px !important;
    }

    .font-extra-large {
        font-size: 20px !important;
    }
}

/* ===================================
   9. VISIBILIDAD Y ANIMATIONS
   =================================== */

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.fade-in {
    animation: fadeIn 0.5s;
}

.fade-out {
    animation: fadeOut 0.5s;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ===================================
   10. ESTADOS
   =================================== */

.active {
    opacity: 1 !important;
}

.inactive {
    opacity: 0.5;
    pointer-events: none;
}

.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}


/* ===================================
   NUEVAS CLASES PARA REEMPLAZAR INLINE STYLES
   =================================== */

/* Display / Visibility */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* Opacity animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
    opacity: 1;
}

.fade-out {
    animation: fadeOut 0.3s ease-out;
    opacity: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Slider/Background Images */
.slide-bg-1 {
    background-image: url('https://images.unsplash.com/photo-1589829545856-d10d557cf95f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
}

.slide-bg-2 {
    background-image: url('https://images.unsplash.com/photo-1450101499163-c8848c66ca85?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
}

/* Layout & Spacing */
.flex-1 {
    flex: 1;
}

.margin-top-20 {
    margin-top: 20px;
}

.padding-top-20 {
    padding-top: 20px;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-description {
    margin-top: 8px;
}

/* Admin link styling */
.admin-link {
    font-size: 0.75rem;
    opacity: 0.35;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.admin-link:hover {
    opacity: 0.75;
}

.admin-link:not(:hover) {
    opacity: 0.35;
}

/* Resoluciones - Animación de tarjetas */
.res-card-animate {
    opacity: 0;
    transform: translateY(16px);
    animation: slideInUp 0.35s ease forwards;
}

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   A11Y CSS - Accesibilidad
   ======================================== */

/* Solo lector de pantalla: ocultar visualmente pero mantener disponible */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Enlace para saltar al contenido principal */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background-color: #000;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
    font-weight: bold;
}

.skip-to-main:focus {
    top: 0;
}

/* Mejorar la visibilidad del foco */
*:focus-visible {
    outline: 3px solid #1e40af;
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid #1e40af;
    outline-offset: 2px;
}

/* Soporte para modo de alto contraste */
@media (prefers-contrast: more) {
    body {
        --text-main: #000;
        --bg-color: #fff;
    }
}

/* ===================================
   ESTILOS DEL FOOTER (EXTERNALIZADO)
   =================================== */

.footer-links {
    margin-top: 20px;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Soporte para movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}


/* Menú Hamburguesa Animación */
.menu-toggle span {
    transition: all 0.3s ease;
}

.menu-toggle.menu-active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.menu-active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.menu-active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.menu-toggle.menu-inactive span:nth-child(1),
.menu-toggle.menu-inactive span:nth-child(3) {
    transform: none;
}

.menu-toggle.menu-inactive span:nth-child(2) {
    opacity: 1;
}

/* Scroll Animation - Fade and Translate */
.fade-out-down {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* ========================================
   LAZYLOAD CSS - Animaciones de carga
   ======================================== */

img.lazy-loading {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

img.lazy-loaded {
    opacity: 1;
}

img.lazy-error {
    display: none;
}

iframe.lazy-loading-iframe {
    background-color: #f0f0f0;
}

/* Animación skeleton para placeholders de carga */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

img.lazy-loading {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}
/* ========================================
   MODERN A11Y PANEL STYLES
   ======================================== */

.a11y-main-btn {
    position: fixed !important;
    bottom: 110px;
    left: 30px;
    right: auto;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #004300;
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    z-index: 2000;
    cursor: pointer;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.a11y-main-btn:hover {
    transform: scale(1.1);
    background: #006400;
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

.a11y-panel {
    position: fixed !important;
    bottom: 180px;
    left: 30px;
    right: auto;
    width: 320px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.2);
    z-index: 2001;
    overflow: hidden;
    animation: panelSlideIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(0,0,0,0.1);
}

@keyframes panelSlideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.a11y-panel-header {
    background: #004300;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.a11y-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.a11y-close-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.a11y-close-btn:hover {
    background: rgba(255,255,255,0.2);
}

.a11y-panel-body {
    padding: 20px;
    max-height: 450px;
    overflow-y: auto;
}

.a11y-group {
    margin-bottom: 20px;
}

.a11y-group-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #666;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.a11y-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.a11y-tool {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.a11y-tool span {
    font-size: 1.2rem;
}

.a11y-tool:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.a11y-tool.active {
    background: #004300;
    color: white;
    border-color: #004300;
}

.a11y-tool-full {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.a11y-tool-full:hover {
    background: #f1f5f9;
}

.a11y-tool-full.active {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.a11y-reset-btn {
    width: 100%;
    margin-top: 10px;
    background: none;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
}

.a11y-reset-btn:hover {
    color: #e74c3c;
    border-color: #e74c3c;
}

/* Accessibility Feature States */
.dyslexic-font {
    font-family: 'OpenDyslexic', 'Comic Sans MS', sans-serif !important;
}

.grayscale {
    filter: grayscale(100%) !important;
}

.underline-links a {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
}

.reading-guide-line {
    position: fixed;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(231, 76, 60, 0.6);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.4);
    z-index: 9999;
    pointer-events: none;
    transform: translateY(-50%);
}

@media (max-width: 480px) {
    .a11y-panel {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 100px;
    }
}

/* ========================================
   PDF MODAL VIEWER
   ======================================== */
.res-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}

.res-modal.active {
    display: flex;
}

.res-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.res-modal-container {
    position: relative;
    width: 90%;
    height: 90%;
    background: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.res-modal-header {
    padding: 15px 25px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.res-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.res-modal-actions {
    display: flex;
    gap: 10px;
}

.res-btn-icon {
    background: white;
    border: 1px solid #e2e8f0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 18px;
}

.res-btn-icon:hover {
    background: #f1f5f9;
    color: #004300;
    border-color: #004300;
}

.res-modal-body {
    flex: 1;
    background: #525659;
}

.res-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 768px) {
    .res-modal-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}
