/**
 * Cookie Consent Styles
 * Estilos para banner e modal de consentimento de cookies
 */

/* ==================== Banner de Cookies ==================== */

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    border-top: 3px solid #6366f1;
}

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

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.cookie-consent-text h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-consent-text p {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.cookie-consent-small {
    font-size: 0.85rem !important;
    color: #64748b !important;
}

.cookie-consent-text a {
    color: #6366f1;
    text-decoration: underline;
    font-weight: 500;
}

.cookie-consent-text a:hover {
    color: #4f46e5;
}

.cookie-consent-actions {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

/* ==================== Modal de Personalização ==================== */

.cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-modal-overlay.show {
    opacity: 1;
}

.cookie-modal {
    background: white;
    border-radius: 1rem;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cookie-modal-overlay.show .cookie-modal {
    transform: scale(1);
}

.cookie-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.cookie-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.cookie-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.cookie-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cookie-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

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

.cookie-category {
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 2px solid #e2e8f0;
    transition: border-color 0.2s;
}

.cookie-category:hover {
    border-color: #cbd5e1;
}

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

.cookie-category-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

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

.cookie-category-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.cookie-category-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cookie-category-details li {
    color: #475569;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.cookie-category-details li:last-child {
    border-bottom: none;
}

.cookie-category-details strong {
    color: #1e293b;
    font-weight: 600;
}

/* ==================== Toggle Switch ==================== */

.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    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: #cbd5e1;
    transition: 0.3s;
    border-radius: 34px;
}

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

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #6366f1;
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== Footer do Modal ==================== */

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

/* ==================== Botões ==================== */

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

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

.btn-secondary {
    background: white;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* ==================== Responsivo ==================== */

@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem 1rem;
    }

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

    .cookie-consent-actions button {
        width: 100%;
    }

    .cookie-modal {
        max-height: 95vh;
    }

    .cookie-modal-header {
        padding: 1rem 1.5rem;
    }

    .cookie-modal-header h2 {
        font-size: 1.25rem;
    }

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

    .cookie-category {
        padding: 1rem;
    }

    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-toggle {
        align-self: flex-start;
    }

    .cookie-modal-footer {
        flex-direction: column;
        padding: 1rem 1.5rem;
    }

    .cookie-modal-footer button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cookie-consent-text h3 {
        font-size: 1.1rem;
    }

    .cookie-consent-text p {
        font-size: 0.9rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* ==================== Animações ==================== */

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

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

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==================== Acessibilidade ==================== */

.cookie-toggle input:focus + .cookie-toggle-slider {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.btn-primary:focus,
.btn-secondary:focus,
.cookie-modal-close:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Remove outline no mouse, mas mantém no teclado */
.btn-primary:focus:not(:focus-visible),
.btn-secondary:focus:not(:focus-visible),
.cookie-modal-close:focus:not(:focus-visible) {
    outline: none;
}
