/* Simple Cookie Consent - Main CSS */
/* Version: 3.0.0 - Com cores de hover e modal configuráveis */

/* Variáveis CSS padrão - serão sobrescritas pelo PHP */
:root {
    /* Cores principais */
    --scc-primary-color: #0f3460;
    --scc-primary-hover: #0a2549;
    --scc-text-on-primary: #ffffff;

    --scc-secondary-color: #16213e;
    --scc-secondary-hover: #0f1a2e;
    --scc-text-on-secondary: #ffffff;

    --scc-bg-color: #1a1a2e;
    --scc-text-color: #ffffff;
    --scc-text-on-bg: #ffffff;

    /* Modal */
    --scc-modal-bg: #ffffff;
    --scc-modal-text: #333333;
    --scc-text-on-modal: #000000;
    --scc-modal-title-color: var(--scc-primary-color);
    --scc-option-title-color: var(--scc-primary-color);

    /* Border Radius */
    --scc-border-radius: 12px;
    --scc-btn-radius: 8px;
    --scc-modal-radius: 16px;

    /* Outros */
    --scc-content-gap: 12px;
    --scc-buttons-gap: 12px;
    --scc-btn-padding: 10px 16px;
    --scc-btn-font-size: 0.9rem;
    --scc-btn-weight: 500;
    --scc-title-size: 1.1rem;
    --scc-text-size: 0.95rem;
    --scc-line-height: 1.5;
}

/* Cookie Banner */
#scc-cookie-banner {
    position: fixed;
    z-index: 99999;
    width: 360px;
    max-width: calc(100vw - 48px);
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--scc-bg-color);
    color: var(--scc-text-color);
    padding: 24px;
    border-radius: var(--scc-border-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: scc-slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Posições */
#scc-cookie-banner.bottom {
    bottom: 24px;
    right: 24px;
    left: auto;
}

#scc-cookie-banner.top {
    top: 24px;
    right: 24px;
    left: auto;
    bottom: auto;
}

/* Animação */
@keyframes scc-slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Conteúdo */
.scc-content {
    display: flex;
    flex-direction: column;
    gap: var(--scc-content-gap);
}

/* Textos */
.scc-text h3 {
    margin: 0 0 8px 0;
    font-size: var(--scc-title-size);
    font-weight: 600;
    color: var(--scc-primary-color);
    line-height: 1.3;
}

.scc-text p {
    margin: 0;
    font-size: var(--scc-text-size);
    line-height: var(--scc-line-height);
    color: var(--scc-text-color);
    opacity: 0.9;
}

/* Link de privacidade */
.scc-privacy-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--scc-primary-color);
    text-decoration: underline;
    transition: opacity 0.2s;
}

.scc-privacy-link:hover {
    opacity: 0.8;
}

/* Botões */
.scc-buttons {
    display: flex;
    gap: var(--scc-buttons-gap);
    width: 100%;
    margin-top: 16px;
}

.scc-btn {
    flex: 1;
    padding: var(--scc-btn-padding);
    border-radius: var(--scc-btn-radius);
    font-size: var(--scc-btn-font-size);
    font-weight: var(--scc-btn-weight);
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
    border: none;
    outline: none;
}

/* Botão Aceitar - usa cor primária */
.scc-btn-accept {
    background: var(--scc-primary-color);
    color: var(--scc-text-on-primary);
}

.scc-btn-accept:hover,
.scc-btn-accept:focus {
    background: var(--scc-primary-hover);
}

/* Botão Configurar - usa cor secundária */
.scc-btn-config {
    background: var(--scc-secondary-color);
    color: var(--scc-text-on-secondary);
}

.scc-btn-config:hover,
.scc-btn-config:focus {
    background: var(--scc-secondary-hover);
}

/* Modal */
#scc-cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

#scc-cookie-modal.active {
    opacity: 1;
    pointer-events: all;
}

.scc-modal-content {
    background: var(--scc-modal-bg);
    width: 100%;
    max-width: 550px;
    border-radius: var(--scc-modal-radius);
    padding: 32px;
    position: relative;
    color: var(--scc-modal-text);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Cabeçalho do Modal */
.scc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.scc-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--scc-modal-title-color);
    line-height: 1.3;
    flex: 1;
}

/* Botão fechar */
.scc-close {
    background: none;
    border: none;
    color: var(--scc-modal-text);
    opacity: 0.7;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 50%;
    transition: all 0.2s;
    margin-left: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.scc-close:hover,
.scc-close:focus {
    background: rgba(0, 0, 0, 0.1);
    color: var(--scc-modal-text);
    opacity: 1;
}

/* Opções */
.scc-modal-body {
    margin-bottom: 24px;
}

.scc-option {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.scc-option:last-child {
    border-bottom: none;
}

.scc-option-info {
    flex: 1;
    padding-right: 20px;
}

.scc-option-info h4 {
    margin: 0 0 6px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--scc-option-title-color);
}

.scc-option-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--scc-modal-text);
    opacity: 0.8;
    line-height: 1.5;
}

/* Switch */
.scc-switch-wrapper {
    flex-shrink: 0;
}

.scc-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
}

.scc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.scc-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e5e5;
    transition: .3s ease;
    border-radius: 34px;
}

.scc-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.scc-slider {
    background-color: var(--scc-primary-color);
}

input:checked+.scc-slider:before {
    transform: translateX(20px);
}

input:disabled+.scc-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Footer do Modal */
.scc-modal-footer {
    display: flex;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.scc-modal-footer .scc-btn {
    flex: 1;
    min-width: 140px;
}

/* Link via shortcode */
.scc-settings-link {
    cursor: pointer;
    color: var(--scc-primary-color);
    text-decoration: underline;
    font-weight: 500;
}

.scc-settings-link:hover {
    opacity: 0.8;
}

/* Responsividade */
@media (max-width: 768px) {
    #scc-cookie-banner {
        width: calc(100% - 32px);
        right: 16px;
        left: 16px;
        padding: 20px;
    }

    #scc-cookie-banner.bottom {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    #scc-cookie-banner.top {
        top: 16px;
        right: 16px;
        left: 16px;
    }

    .scc-modal-content {
        padding: 24px;
        max-height: 85vh;
    }

    .scc-buttons,
    .scc-modal-footer {
        flex-direction: column;
    }

    .scc-modal-footer .scc-btn {
        width: 100%;
    }

    .scc-option {
        flex-direction: column;
        gap: 12px;
    }

    .scc-option-info {
        padding-right: 0;
    }

    .scc-switch-wrapper {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .scc-modal-content {
        padding: 20px;
    }

    .scc-modal-header h2 {
        font-size: 1.3rem;
    }

    .scc-modal-header {
        flex-direction: column;
        gap: 16px;
    }

    .scc-close {
        align-self: flex-end;
        margin-left: 0;
    }
}