/**
 * Cookie Consent Styles - GDPR Compliant
 * Estilos adicionales para el sistema de consentimiento de cookies
 */

/* Estilos base para el overlay */
.cookie-consent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    backdrop-filter: blur(2px);
    animation: fadeIn 0.3s ease-out;
}

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

/* Modal principal */
.cookie-consent-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header del modal */
.cookie-consent-header {
    padding: 24px 24px 0;
    border-bottom: 1px solid #e5e7eb;
}

.cookie-consent-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.cookie-consent-description {
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 16px 0;
    font-size: 14px;
}

/* Cuerpo del modal */
.cookie-consent-body {
    padding: 24px;
}

/* Tipos de cookies */
.cookie-type {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: border-color 0.2s ease;
}

.cookie-type:hover {
    border-color: #d1d5db;
}

.cookie-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cookie-type-title {
    font-weight: 600;
    color: #111827;
    margin: 0;
    font-size: 16px;
}

.cookie-type-desc {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Toggle switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

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

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

input:checked + .cookie-slider {
    background-color: #f97316;
}

input:checked + .cookie-slider:before {
    transform: translateX(20px);
}

input:disabled + .cookie-slider {
    background-color: #f97316;
    opacity: 0.6;
    cursor: not-allowed;
}

input:focus + .cookie-slider {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* Footer del modal */
.cookie-consent-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Botones */
.cookie-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-size: 14px;
    min-width: 100px;
    text-align: center;
    outline: none;
}

.cookie-btn:focus {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.cookie-btn-primary {
    background-color: #f97316;
    color: white;
}

.cookie-btn-primary:hover {
    background-color: #ea580c;
    transform: translateY(-1px);
}

.cookie-btn-primary:active {
    transform: translateY(0);
}

.cookie-btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.cookie-btn-secondary:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

/* Enlaces */
.cookie-policy-link {
    color: #f97316;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.cookie-policy-link:hover {
    color: #ea580c;
    text-decoration: underline;
}

/* Banner inferior */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 20px;
    z-index: 9999;
    max-width: 400px;
    margin: 0 auto;
    animation: slideInUp 0.4s ease-out;
    border: 1px solid #e5e7eb;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-banner-text {
    margin-bottom: 16px;
    color: #374151;
    line-height: 1.6;
    font-size: 14px;
}

.cookie-banner-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Botón flotante para reabrir configuración */
.cookie-settings-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #f97316;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
    transition: all 0.3s ease;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.cookie-settings-btn:hover {
    background: #ea580c;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
}

.cookie-settings-btn:active {
    transform: scale(0.95);
}

/* Responsive design */
@media (max-width: 640px) {
    .cookie-consent-modal {
        margin: 10px;
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
    }
    
    .cookie-consent-header,
    .cookie-consent-body {
        padding: 16px;
    }
    
    .cookie-consent-footer {
        padding: 0 16px 16px;
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }
    
    .cookie-banner-actions {
        flex-direction: column;
    }
    
    .cookie-type-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .cookie-toggle {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .cookie-consent-title {
        font-size: 18px;
    }
    
    .cookie-type-title {
        font-size: 14px;
    }
    
    .cookie-type-desc {
        font-size: 13px;
    }
    
    .cookie-consent-description {
        font-size: 13px;
    }
}

/* Modo oscuro (opcional) */
@media (prefers-color-scheme: dark) {
    .cookie-consent-modal {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .cookie-consent-header {
        border-bottom-color: #374151;
    }
    
    .cookie-consent-title {
        color: #f9fafb;
    }
    
    .cookie-consent-description,
    .cookie-type-desc {
        color: #d1d5db;
    }
    
    .cookie-type {
        border-color: #374151;
        background: #111827;
    }
    
    .cookie-type:hover {
        border-color: #4b5563;
    }
    
    .cookie-type-title {
        color: #f9fafb;
    }
    
    .cookie-btn-secondary {
        background-color: #374151;
        color: #d1d5db;
        border-color: #4b5563;
    }
    
    .cookie-btn-secondary:hover {
        background-color: #4b5563;
        border-color: #6b7280;
    }
    
    .cookie-banner {
        background: #1f2937;
        border-color: #374151;
    }
    
    .cookie-banner-text {
        color: #d1d5db;
    }
}

/* Accesibilidad */
.cookie-consent-modal:focus-within {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

/* Animaciones reducidas para usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-overlay,
    .cookie-consent-modal,
    .cookie-banner {
        animation: none;
    }
    
    .cookie-slider,
    .cookie-slider:before,
    .cookie-btn {
        transition: none;
    }
}

/* Estados de carga */
.cookie-consent-loading {
    opacity: 0.7;
    pointer-events: none;
}

.cookie-consent-loading .cookie-btn {
    cursor: not-allowed;
}

/* Indicador de cookies activas */
.cookie-status-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 9997;
    display: none;
}

.cookie-status-indicator.show {
    display: block;
}