/**
 * Estilos para el Modal de Cookies - Versión Optimizada y Corregida
 * Diseño responsive, accesible y compatible con todos los navegadores
 */

/* =============================================
   ESTILOS PRINCIPALES DEL MODAL
   ============================================= */
/* Animación para el escudo de seguridad */

#cookie-modal-overlay {
    backdrop-filter: none;
    background-color: rgba(0, 0, 0, 0.7);
    transition: opacity 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#cookie-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

#cookie-modal {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    display: none;
    z-index: 10000;
    position: relative;
    opacity: 0;
    visibility: hidden;
}

#cookie-modal-overlay.active #cookie-modal {
    display: flex;
    flex-direction: column;
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Añade esto para navegadores basados en Chromium como Brave */
@supports (-webkit-appearance:none) {
    #cookie-modal-overlay {
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
    }
}

/* Contenido del modal */
.cookie-modal-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.cookie-modal-header {
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.cookie-modal-title {
    margin: 0;
    color: #222222;
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 600;
}

.cookie-modal-body p {
    margin: 0 0 1rem;
    color: #555555;
    line-height: 1.6;
    font-size: 1rem;
}

/* =============================================
   BOTONES Y ACCIONES
   ============================================= */

.cookie-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.cookie-btn {
    padding: 0.75rem 1.75rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 1rem;
    min-width: 180px;
    height: 2em;
    text-align: center;
    position: relative;
    align-items: center;
    display: inline-flex;
    gap: 0.5em;
}

.cookie-btn:focus {
    outline: 2px solid rgba(0, 0, 0, 0.3);
    outline-offset: 2px;
}

.accepted-btn {
    background: rgb(0, 138, 156);
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.accepted-btn:hover {
    background: rgb(0, 108, 122);
    transform: translateY(-2px);
}



.reject-btn {
    background-color: #f44336;
    color: white;
}

.reject-btn:hover, .reject-btn:focus {
    background-color: #d32f2f;
    transform: translateY(-2px);
}

* Estados de carga para botones */
.cookie-btn.loading {
    opacity: 0.8;
    pointer-events: none;
    position: relative;
    padding-right: 2.5rem;
}

.cookie-btn.loading::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

/* Animación de spinner */
@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Deshabilitar scroll cuando el modal está abierto */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* =============================================
   FOOTER Y ENLACES
   ============================================= */

.cookie-modal-footer {
    margin-top: 0.5rem;
}

.cookie-more-info {
    font-size: 0.875rem;
    color: #666666;
    margin: 0 0 0.5rem;
    text-align: center;
}

.cookie-more-info a {
    color: #2196F3;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.cookie-more-info a:hover {
    color: #0d8aee;
    text-decoration: underline;
}

.cookie-assurance {
    text-align: center;
    color: #666;
    font-size: 0.85em;
    margin: 0;
    font-style: italic;
}

/* =============================================
   ESTILOS PARA CONTENIDO RESTRINGIDO
   ============================================= */

.restricted-link {
    color: #666666;
    cursor: not-allowed;
    position: relative;
    padding-right: 24px;
    opacity: 0.8;
}

.lock-icon {
    margin-left: 6px;
    color: #ff5722;
    font-size: 0.9em;
}

.restricted-content-notice {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
    border-radius: 0 4px 4px 0;
}

/* Tooltip para enlaces bloqueados */
.cookie-tooltip {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #ff5722;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    z-index: 1000000;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.3s ease forwards;
    max-width: 90%;
    text-align: center;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

@media (max-width: 768px) {
    #cookie-modal {
        padding: 1.5rem;
        margin: 1rem auto;
    }

    .cookie-modal-title {
        font-size: 1.3rem;
    }

    .cookie-modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .cookie-btn {
        width: 100%;
        min-width: auto;
    }

    .restricted-content-notice {
        padding: 1rem;
        margin: 1.5rem 0;
    }
}

@media (max-width: 480px) {
    #cookie-modal {
        width: 95%;
        padding: 1.25rem;
    }

    .cookie-modal-content {
        gap: 1rem;
    }
}

/* =============================================
   SCROLLBAR PERSONALIZADO (Navegadores WebKit)
   ============================================= */

#cookie-modal-overlay::-webkit-scrollbar {
    width: 6px;
}

#cookie-modal-overlay::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#cookie-modal::-webkit-scrollbar {
    width: 8px;
}

#cookie-modal::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

#cookie-modal::-webkit-scrollbar-thumb {
    background-color: #cccccc;
    border-radius: 4px;
}

#cookie-modal::-webkit-scrollbar-thumb:hover {
    background-color: #aaaaaa;
}

/* =============================================
   ESTILOS PARA PÁGINA DE CONTENIDO RESTRINGIDO
   ============================================= */

.restricted-content-container {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    max-width: 100%;
    overflow-x: hidden;
}

/* Hero Section */
.restricted-hero {
    background: linear-gradient(135deg, #3ab887 0%, #2575fc 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.restricted-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxkZWZzPjxwYXR0ZXJuIGlkPSJwYXR0ZXJuIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHBhdHRlcm5UcmFuc2Zvcm09InJvdGF0ZSg0NSkiPjxyZWN0IHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjA1KSIvPjwvcGF0dGVybj48L2RlZnM+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNwYXR0ZXJuKSIvPjwvc3ZnPg==');
}

.restricted-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.restricted-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.restricted-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Botones CTA */
.restricted-btn {
    background: white;
    color: #2575fc;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: 0.5rem;
}

.restricted-btn.large {
    padding: 1.2rem 2.5rem;
    font-size: 1.3rem;
}


.restricted-btn:active {
    transform: translateY(1px);
}

.icon-lock, .icon-unlock, .icon-shield {
    margin-right: 10px;
    font-size: 1.2em;
}

/* Mensaje de seguridad */
.restricted-assurance {
    font-size: 0.9rem;
    margin-top: 1.5rem;
    opacity: 0.9;
}

.restricted-assurance a {
    color: white;
    text-decoration: underline;
    font-weight: 500;
    transition: opacity 0.2s;
}

.restricted-assurance a:hover {
    opacity: 0.8;
}

/* Grid de posts */
.restricted-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.restricted-post-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    animation: fadeIn 0.5s ease forwards;
}

.restricted-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.post-card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.post-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    transition: opacity 0.3s ease;
}

.post-lock-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255,255,255,80%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #2575fc;
}

.post-card-content {
    padding: 1.5rem;
}

.post-card-title {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: #222;
}

.post-card-excerpt {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.post-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #777;
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
}

.post-read-more {
    color: #008a9c;
    font-weight: 500;
    transition: all 0.3s ease;
}

.post-read-more.unlocked {
    color: #008a9c;
    font-weight: 600;
    cursor: pointer;
    display:flex;
}

.post-read-more.unlocked:hover {
    text-decoration: underline;
    transform: translateX(5px);
}

/* Footer CTA */
.restricted-footer-cta {
    background: #f8f9fa;
    padding: 4rem 2rem;
    text-align: center;
    margin-top: 2rem;
}

.cta-container {
    max-width: 800px;
    margin: 0 auto;
}

.cta-container h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #222;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.restricted-post-card:nth-child(1) { animation-delay: 0.1s; }
.restricted-post-card:nth-child(2) { animation-delay: 0.2s; }
.restricted-post-card:nth-child(3) { animation-delay: 0.3s; }
.restricted-post-card:nth-child(4) { animation-delay: 0.4s; }
.restricted-post-card:nth-child(5) { animation-delay: 0.5s; }
.restricted-post-card:nth-child(6) { animation-delay: 0.6s; }

/* Efecto de pulsación */
@keyframes buttonClick {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/*.restricted-btn:active {
    animation: buttonClick 0.2s ease;
}*/

/* Responsive */
@media (max-width: 768px) {
    .restricted-title {
        font-size: 2rem;
    }
    
    .restricted-subtitle {
        font-size: 1.1rem;
    }
    
    .restricted-posts-grid {
        grid-template-columns: 1fr;
        padding: 2rem 1rem;
    }
    
    .restricted-btn {
        width: 100%;
        margin: 0.5rem 0;
    }
}

/* Estilos para el estado de "cargando" */
.restricted-btn[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

.post-read-more[data-post-link] {
    position: relative;
    padding-left: 20px;
}
.post-read-more[data-post-link]:hover::before {
    transform: translateX(3px);
}

/* Tarjetas desbloqueadas */
.restricted-post-card.unlocked {
    cursor: pointer;
}

.restricted-post-card.unlocked:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.restricted-post-card[data-post-id] {
    transition: all 0.3s ease;
}

.restricted-post-card[data-post-id]:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Estado de botones aceptados */
.restricted-btn[disabled].accepted {
    background-color: #4CAF50 !important;
    color: white !important;
    opacity: 1;
    cursor: default;
}

.cookie-transparency-list {
    padding-left: 0.5rem;
    margin: 0.5rem 0;
    list-style-type: none;
    font-size:15px;
}

.cookie-transparency-list li {
    margin-bottom: 0.5rem;
    position: relative;
    line-height: 1.5;
    padding-left: 1rem;
}

.cookie-transparency-list li::before {
    position: absolute;
    left: 0;
    top: 0.2rem;
    font-size: 1.2em;
}

.icon-m {
    width: 1em;
    height: auto;
    max-width: 100%;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    position: relative;
    top: -0.1em;
}