/**
 * THS Radionica - Cookie Consent Banner Styles
 * 
 * Banner responsivo para gestão de consentimento de cookies.
 * 4 categorias: essenciais, funcionais, analíticos, marketing.
 * 
 * @since 2.1.0
 */

/* ============================================================
   BANNER PRINCIPAL
   ============================================================ */
.ths-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    background: var(--ths-cookie-bg, #ffffff);
    border-top: 3px solid var(--ths-cookie-primary, #8b5cf6);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 0;
    font-family: var(--ths-cookie-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ths-cookie-text, #333);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

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

.ths-cookie-banner.ths-cookie-hidden {
    transform: translateY(100%);
    pointer-events: none;
}

/* ============================================================
   VISTA SIMPLES (banner compacto)
   ============================================================ */
.ths-cookie-simple {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.ths-cookie-simple-text {
    flex: 1;
    font-size: 14px;
    color: var(--ths-cookie-text, #555);
}

.ths-cookie-simple-text a {
    color: var(--ths-cookie-primary, #8b5cf6);
    text-decoration: underline;
}

.ths-cookie-simple-text a:hover {
    color: var(--ths-cookie-primary-hover, #7c3aed);
}

.ths-cookie-simple-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* ============================================================
   VISTA DETALHADA (painel de personalização)
   ============================================================ */
.ths-cookie-details {
    display: none;
    padding: 20px 24px 24px;
    max-width: 1400px;
    margin: 0 auto;
    border-top: 1px solid #eee;
}

.ths-cookie-details.ths-cookie-details-visible {
    display: block;
}

.ths-cookie-details-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ths-cookie-text, #333);
    margin: 0 0 16px 0;
}

/* ============================================================
   CATEGORIAS DE COOKIES
   ============================================================ */
.ths-cookie-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.ths-cookie-category {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--ths-cookie-radius, 8px);
    padding: 14px 16px;
    transition: border-color 0.2s;
}

.ths-cookie-category:hover {
    border-color: var(--ths-cookie-primary, #c4b5fd);
}

.ths-cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.ths-cookie-category-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--ths-cookie-text, #333);
}

.ths-cookie-category-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.ths-cookie-category-desc {
    font-size: 12px;
    color: #777;
    margin: 0;
    line-height: 1.4;
}

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */
.ths-cookie-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

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

.ths-cookie-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ths-cookie-toggle input:checked + .ths-cookie-toggle-slider {
    background: var(--ths-cookie-primary, #8b5cf6);
}

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

.ths-cookie-toggle input:disabled + .ths-cookie-toggle-slider {
    background: #a5b4fc;
    cursor: not-allowed;
    opacity: 0.7;
}

.ths-cookie-toggle input:disabled:checked + .ths-cookie-toggle-slider {
    background: #a5b4fc;
}

/* Badge "Sempre ativo" */
.ths-cookie-always-on {
    font-size: 11px;
    color: #16a34a;
    font-weight: 600;
    white-space: nowrap;
}

/* ============================================================
   BOTÕES
   ============================================================ */
.ths-cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--ths-cookie-radius, 6px);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.ths-cookie-btn:focus {
    outline: 2px solid var(--ths-cookie-primary, #8b5cf6);
    outline-offset: 2px;
}

/* Aceitar todos */
.ths-cookie-btn-accept {
    background: var(--ths-cookie-primary, #8b5cf6);
    color: #fff;
}

.ths-cookie-btn-accept:hover {
    background: var(--ths-cookie-primary-hover, #7c3aed);
}

/* Apenas essenciais */
.ths-cookie-btn-reject {
    background: var(--ths-cookie-secondary-bg, #ffffff) !important;
    color: var(--ths-cookie-secondary-text, #555) !important;
    border: 1px solid var(--ths-cookie-secondary-border, #8b5cf6) !important;
}

.ths-cookie-btn-reject:hover {
    background: var(--ths-cookie-secondary-hover-bg, #f3f0ff) !important;
    color: var(--ths-cookie-secondary-hover-text, #7c3aed) !important;
    border-color: var(--ths-cookie-secondary-border, #8b5cf6) !important;
}

/* Personalizar / Guardar */
.ths-cookie-btn-customize {
    background: var(--ths-cookie-secondary-bg, #ffffff) !important;
    color: var(--ths-cookie-secondary-text, #555) !important;
    border: 1px solid var(--ths-cookie-secondary-border, #8b5cf6) !important;
}

.ths-cookie-btn-customize:hover {
    background: var(--ths-cookie-secondary-hover-bg, #f3f0ff) !important;
    color: var(--ths-cookie-secondary-hover-text, #7c3aed) !important;
    border-color: var(--ths-cookie-secondary-border, #8b5cf6) !important;
}

/* Guardar preferências */
.ths-cookie-btn-save {
    background: var(--ths-cookie-primary, #8b5cf6);
    color: #fff;
}

.ths-cookie-btn-save:hover {
    background: var(--ths-cookie-primary-hover, #7c3aed);
}

.ths-cookie-details-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================================
   LINK NO RODAPÉ (para reabrir o banner)
   ============================================================ */
.ths-cookie-settings-link {
    cursor: pointer;
    color: var(--ths-cookie-primary, #8b5cf6);
    text-decoration: underline;
    font-size: 13px;
}

.ths-cookie-settings-link:hover {
    color: var(--ths-cookie-primary-hover, #7c3aed);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .ths-cookie-simple {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 16px;
        gap: 12px;
    }

    .ths-cookie-simple-text {
        font-size: 13px;
        text-align: center;
    }

    .ths-cookie-simple-actions {
        flex-direction: column;
        gap: 8px;
    }

    .ths-cookie-btn {
        width: 100%;
        padding: 12px 16px;
    }

    .ths-cookie-details {
        padding: 16px;
    }

    .ths-cookie-categories {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .ths-cookie-details-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .ths-cookie-simple {
        padding: 12px;
    }

    .ths-cookie-simple-text {
        font-size: 12px;
    }

    .ths-cookie-btn {
        font-size: 12px;
        padding: 10px 14px;
    }
}
