/* ========================================
   SISTEMA DE COOKIES - ONCHAT
   Diseño moderno y limpio
   ======================================== */

/* Variables para el modal */
:root {
    --modal-bg: #ffffff;
    --modal-text: #1f2937;
    --modal-border: #e5e7eb;
    --modal-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --modal-radius: 16px;
    --primary-blue: #667eea;
    --primary-blue-hover: #5a67d8;
    --success-green: #10b981;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
    :root {
        --modal-bg: #1f2937;
        --modal-text: #f9fafb;
        --modal-border: #374151;
        --gray-100: #374151;
        --gray-200: #4b5563;
        --gray-500: #9ca3af;
        --gray-600: #d1d5db;
        --gray-700: #e5e7eb;
        --gray-800: #f9fafb;
    }
}

/* ========================================
   BANNER PRINCIPAL MODERNO
   ======================================== */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
    padding: 0;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    position: relative;
}

.cookie-banner-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.05)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.cookie-banner-text {
    flex: 1;
    min-width: 300px;
    color: white;
    position: relative;
    z-index: 1;
}

.cookie-banner-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cookie-banner-message {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    opacity: 0.95;
    font-weight: 400;
}

.cookie-banner-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Botones del banner modernos */
.cookie-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.cookie-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.cookie-btn:hover::before {
    left: 100%;
}

.cookie-btn-primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cookie-btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.cookie-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.cookie-btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cookie-btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Iconos del banner */
.cookie-banner-icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Animación de entrada del banner */
@keyframes bannerSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-banner.show {
    animation: bannerSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive para el banner */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 20px;
        gap: 16px;
    }
    
    .cookie-banner-text {
        min-width: auto;
        margin-bottom: 0;
    }
    
    .cookie-banner-actions {
        justify-content: center;
        flex-direction: column;
        width: 100%;
    }
    
    .cookie-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }
    
    .cookie-banner-title {
        font-size: 16px;
        justify-content: center;
    }
    
    .cookie-banner-message {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .cookie-banner-content {
        padding: 16px;
    }
    
    .cookie-banner-title {
        font-size: 15px;
    }
    
    .cookie-banner-message {
        font-size: 12px;
    }
    
    .cookie-btn {
        padding: 12px 16px;
        font-size: 13px;
    }
}

.ngf-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    width: 100vw;
    height: 100vh;
}

.ngf-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

body.modal-open .cookie-banner {
    display: none !important;
}

/* ========================================
   MODAL PRINCIPAL
   ======================================== */

.ngf-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--modal-bg);
    border-radius: var(--modal-radius);
    box-shadow: var(--modal-shadow);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid var(--modal-border);
    z-index: 10002;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

/* ========================================
   HEADER DEL MODAL
   ======================================== */

.ngf-modal-header {
    padding: 20px 24px 12px;
    border-bottom: 1px solid var(--modal-border);
    background: var(--gray-100);
    position: relative;
}

.ngf-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--modal-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ngf-modal-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin: 8px 0 0 0;
    line-height: 1.4;
}

.ngf-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--gray-500);
    font-size: 18px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: none;
}

.ngf-modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* ========================================
   CUERPO DEL MODAL
   ======================================== */

.ngf-modal-body {
    padding: 20px 24px;
    height: auto;
    overflow: hidden;
    scroll-behavior: unset;
    -webkit-overflow-scrolling: unset;
    will-change: auto;
    backface-visibility: unset;
    -webkit-backface-visibility: unset;
}

/* ========================================
   CATEGORÍAS DE COOKIES
   ======================================== */

.ngf-category {
    margin-bottom: 16px;
    padding: 14px;
    background: var(--gray-100);
    border: 1px solid var(--modal-border);
    border-radius: 12px;
    will-change: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.ngf-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ngf-category-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--modal-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ngf-category-description {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.4;
    margin: 0;
}

/* ========================================
   SWITCHES/TOGGLES
   ======================================== */

.ngf-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.ngf-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ngf-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: background-color 0.2s ease;
    border-radius: 24px;
}

.ngf-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: transform 0.2s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ngf-switch input:checked + .ngf-switch-slider {
    background-color: var(--primary-blue);
}

.ngf-switch input:checked + .ngf-switch-slider:before {
    transform: translateX(20px);
}

.ngf-switch input:disabled + .ngf-switch-slider {
    background-color: var(--success-green);
    cursor: not-allowed;
}

.ngf-switch input:disabled + .ngf-switch-slider:before {
    background-color: white;
}

/* ========================================
   FOOTER DEL MODAL
   ======================================== */

.ngf-modal-footer {
    padding: 12px 24px 20px;
    border-top: 1px solid var(--modal-border);
    background: var(--gray-100);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ========================================
   BOTONES
   ======================================== */

.ngf-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: none;
    min-width: 120px;
    justify-content: center;
}

.ngf-btn-primary {
    background: var(--primary-blue);
    color: white;
}

.ngf-btn-primary:hover {
    background: var(--primary-blue-hover);
}

.ngf-btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.ngf-btn-secondary:hover {
    background: var(--gray-500);
    color: white;
}

.ngf-btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
}

.ngf-btn-outline:hover {
    background: var(--primary-blue);
    color: white;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 640px) {
    .ngf-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .ngf-modal-header,
    .ngf-modal-body,
    .ngf-modal-footer {
        padding: 16px;
    }
    
    .ngf-modal-footer {
        flex-direction: column;
    }
    
    .ngf-btn {
        width: 100%;
    }
}

/* ========================================
   ANIMACIONES SUAVES OPTIMIZADAS
   ======================================== */

@keyframes ngf-fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.ngf-modal-overlay.show .ngf-modal {
    animation: ngf-fadeIn 0.3s ease-out;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

/* ========================================
   ACCESIBILIDAD
   ======================================== */

.ngf-modal-close:focus,
.ngf-btn:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

.ngf-switch:focus-within .ngf-switch-slider {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* ========================================
   ESTADOS ESPECIALES
   ======================================== */

.ngf-category.required {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

.ngf-category.required .ngf-category-title {
    color: var(--success-green);
}

/* ========================================
   ICONOS
   ======================================== */

.ngf-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
}

.ngf-icon-shield {
    color: var(--success-green);
}

.ngf-icon-chart {
    color: var(--primary-blue);
}

.ngf-icon-bullhorn {
    color: #f59e0b;
}

.ngf-icon-cog {
    color: var(--gray-500);
}

.ngf-icon-cookie {
    color: #8b5cf6;
}




