/**
 * Cookie Consent Popup - LGPD Compliant
 * Estilo para banner de consentimento de cookies
 */

/* Overlay escuro de fundo */
.cookie-consent-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-consent-overlay.show {
    display: block;
    opacity: 1;
}

/* Container principal do popup */
.cookie-consent-popup {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    overflow: hidden;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.cookie-consent-popup.show {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

/* Cabeçalho do popup */
.cookie-consent-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cookie-consent-header svg {
    flex-shrink: 0;
}

.cookie-consent-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

/* Corpo do popup */
.cookie-consent-body {
    padding: 24px;
}

.cookie-consent-description {
    color: #374151;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.cookie-consent-description a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 600;
}

.cookie-consent-description a:hover {
    color: #1e40af;
}

/* Opções de cookies */
.cookie-options {
    margin-bottom: 20px;
}

.cookie-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.cookie-option:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.cookie-option.disabled {
    background: #f3f4f6;
    opacity: 0.8;
}

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

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

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

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #10b981;
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    cursor: not-allowed;
    background-color: #9ca3af;
}

/* Informações da opção */
.cookie-option-info {
    flex: 1;
}

.cookie-option-title {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cookie-option-badge {
    display: inline-block;
    background: #10b981;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}

.cookie-option-description {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

/* Botões de ação */
.cookie-consent-actions {
    display: flex;
    gap: 10px;
}

.cookie-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.cookie-btn-primary {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
}

.cookie-btn-primary:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.cookie-btn-secondary {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.cookie-btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

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

/* Link de configurações no rodapé */
.cookie-settings-link {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: white;
    color: #374151;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 9997;
    display: none;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.cookie-settings-link.show {
    display: flex;
}

.cookie-settings-link:hover {
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Responsividade Mobile */
@media (max-width: 640px) {
    .cookie-consent-popup {
        bottom: 0;
        right: 0;
        left: 0;
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        margin: 0;
    }

    .cookie-consent-header {
        padding: 16px 20px;
    }

    .cookie-consent-header h3 {
        font-size: 16px;
    }

    .cookie-consent-body {
        padding: 20px;
        max-height: 70vh;
        overflow-y: auto;
    }

    .cookie-consent-actions {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
    }

    .cookie-settings-link {
        bottom: 10px;
        left: 10px;
        font-size: 12px;
        padding: 8px 12px;
    }
}

/* Animação de entrada */
@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Estado de carregamento */
.cookie-btn.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.cookie-btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
