/**
 * Estilos para el Sistema de Gestión de Cookies - WEBAVANZADA
 * Versión: 1.0.0
 * Descripción: Estilos modernos y responsivos para el sistema de cookies
 */

/* ===== BANNER DE COOKIES ===== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #ffffff;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.cookie-banner-header {
    margin-bottom: 1.5rem;
}

.cookie-banner-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-banner-header p {
    font-size: 1rem;
    line-height: 1.6;
    color: #e2e8f0;
    margin: 0;
}

.cookie-banner-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    min-height: 44px;
}

.cookie-btn-primary {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1e293b;
}

.cookie-btn-primary:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.4);
}

.cookie-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.cookie-btn-reject {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.cookie-btn-reject:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

.cookie-banner-footer {
    display: flex;
    gap: 2rem;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.cookie-banner-footer a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.cookie-banner-footer a:hover {
    color: #fbbf24;
}

/* ===== MODAL DE PREFERENCIAS ===== */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-modal.show {
    opacity: 1;
    visibility: visible;
}

.cookie-modal-content {
    background: #ffffff;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cookie-modal.show .cookie-modal-content {
    transform: scale(1) translateY(0);
}

.cookie-modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.cookie-modal-body {
    padding: 1.5rem 2rem;
}

.cookie-modal-description {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* ===== CATEGORÍAS DE COOKIES ===== */
.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cookie-category {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.cookie-category.required {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fbbf24;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.cookie-category-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.cookie-category-info p {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.cookie-category-toggle {
    flex-shrink: 0;
    margin-left: 1rem;
}

.cookie-category-details {
    color: #94a3b8;
    font-size: 0.8rem;
}

/* ===== SWITCH TOGGLE ===== */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

input:disabled + .slider {
    background: #fbbf24;
    cursor: not-allowed;
}

input:disabled + .slider:before {
    background: #ffffff;
}

.cookie-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ===== NOTIFICACIONES ===== */
.cookie-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: #ffffff;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10002;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 400px;
    border-left: 4px solid #10b981;
}

.cookie-notification.show {
    transform: translateX(0);
}

.cookie-notification.success {
    border-left-color: #10b981;
}

.cookie-notification.success i {
    color: #10b981;
}

.cookie-notification span {
    color: #1e293b;
    font-weight: 500;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .cookie-banner-content {
        padding: 1rem;
    }
    
    .cookie-banner-header h3 {
        font-size: 1.25rem;
    }
    
    .cookie-banner-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .cookie-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-banner-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .cookie-modal {
        padding: 1rem;
    }
    
    .cookie-modal-content {
        max-height: 95vh;
    }
    
    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer {
        padding: 1rem 1.5rem;
    }
    
    .cookie-category-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cookie-category-toggle {
        margin-left: 0;
        align-self: flex-end;
    }
    
    .cookie-modal-footer {
        flex-direction: column;
    }
    
    .cookie-notification {
        right: 1rem;
        left: 1rem;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .cookie-notification.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .cookie-banner-header h3 {
        font-size: 1.1rem;
    }
    
    .cookie-banner-header p {
        font-size: 0.9rem;
    }
    
    .cookie-modal-header h3 {
        font-size: 1.25rem;
    }
    
    .cookie-category {
        padding: 1rem;
    }
}

/* ===== ANIMACIONES ADICIONALES ===== */
@keyframes cookieBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.cookie-banner-header h3 {
    animation: cookieBounce 2s ease-in-out infinite;
}

/* ===== ESTADOS DE HOVER MEJORADOS ===== */
.cookie-category:hover .cookie-category-info h4 {
    color: #2563eb;
}

.cookie-category.required:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.3);
}

/* ===== SCROLLBAR PERSONALIZADO ===== */
.cookie-modal-content::-webkit-scrollbar {
    width: 8px;
}

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

.cookie-modal-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.cookie-modal-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== FOCUS STATES PARA ACCESIBILIDAD ===== */
.cookie-btn:focus,
.cookie-modal-close:focus,
.switch input:focus + .slider {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .cookie-modal-content {
        background: #1e293b;
        color: #ffffff;
    }
    
    .cookie-modal-header {
        border-bottom-color: #334155;
    }
    
    .cookie-modal-header h3 {
        color: #ffffff;
    }
    
    .cookie-category {
        background: #334155;
        color: #ffffff;
    }
    
    .cookie-category:hover {
        background: #475569;
    }
    
    .cookie-category.required {
        background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
        border-color: #fbbf24;
    }
    
    .cookie-category-info h4 {
        color: #ffffff;
    }
    
    .cookie-category-info p {
        color: #cbd5e1;
    }
    
    .cookie-modal-footer {
        border-top-color: #334155;
    }
    
    .cookie-notification {
        background: #1e293b;
        color: #ffffff;
    }
    
    .cookie-notification span {
        color: #ffffff;
    }
}
