/* BeluCookie - Compact Bottom-Right Banner */

.belucookie-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    display: none;
}

.belucookie-banner.active {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 15px;
}

.belucookie-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
}

.belucookie-container {
    position: relative;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    width: 400px;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    overflow-y: auto;
}

.belucookie-main,
.belucookie-settings {
    padding: 16px;
}

.belucookie-title {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: #222;
}

.belucookie-text {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

.belucookie-quick-toggles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: #f1f1f1;
    border-radius: 6px;
}

.belucookie-quick-toggle-item {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 3px 0;
}

.belucookie-quick-toggle-label {
    font-size: 12px;
    font-weight: 500;
    color: #444;
}

.belucookie-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.belucookie-btn {
    flex: 1;
    padding: 11px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    border: none;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.belucookie-btn:hover {
    opacity: 0.9;
}

.belucookie-btn:focus,
.belucookie-btn:active,
.belucookie-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border-style: solid !important;
}

.belucookie-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: #888;
    flex-wrap: wrap;
}

.belucookie-link {
    color: #666;
    text-decoration: none;
}

.belucookie-link:hover {
    opacity: 0.85;
}

.belucookie-details-link {
    color: var(--belucookie-primary, #376e78) !important;
    font-weight: 500;
    text-decoration: none !important;
    font-size: 13px;
}

.belucookie-details-link:hover {
    opacity: 0.85;
}

.belucookie-separator {
    color: #ddd;
}

/* ===== Toggle Switch - Fixed Dimensions ===== */
.belucookie-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.belucookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
    pointer-events: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.belucookie-toggle input[type="checkbox"] {
    display: none !important;
}

/* Track */
.belucookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 46px;
    height: 26px;
    background-color: #ccc;
    border-radius: 26px;
    transition: background-color 0.25s ease;
}

/* Knob */
.belucookie-toggle-slider:before {
    position: absolute;
    content: "";
    width: 20px;
    height: 20px;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.25s ease, left 0.25s ease;
}

.belucookie-toggle input:checked + .belucookie-toggle-slider {
    background-color: var(--belucookie-primary, #376e78);
}

.belucookie-toggle input:checked + .belucookie-toggle-slider:before {
    left: 3px;
    transform: translateY(-50%) translateX(20px);
}

.belucookie-toggle input:disabled + .belucookie-toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Ensure all checkbox inputs in banner are completely hidden */
.belucookie-banner input[type="checkbox"],
.belucookie-banner input[type="checkbox"]:checked,
.belucookie-banner input[type="checkbox"]::before,
.belucookie-banner input[type="checkbox"]::after,
.belucookie-banner input[type="checkbox"]:checked::before,
.belucookie-banner input[type="checkbox"]:checked::after {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    opacity: 0 !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    content: none !important;
}

/* Settings View */
.belucookie-settings-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #222;
}

.belucookie-quick-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    margin-bottom: 12px;
}

.belucookie-quick-btn {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 500;
    background: var(--belucookie-primary, #376e78);
    color: #fff;
    border: none !important;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: none !important;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.belucookie-quick-btn:hover {
    opacity: 0.9;
}

.belucookie-quick-btn:focus,
.belucookie-quick-btn:active,
.belucookie-quick-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Categories */
.belucookie-categories {
    margin-bottom: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.belucookie-category {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

.belucookie-category:first-child {
    border-top: 1px solid #eee;
}

.belucookie-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.belucookie-category-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.belucookie-category-name {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.belucookie-category-count {
    color: #999;
    font-size: 12px;
}


.belucookie-expand-btn {
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.belucookie-expand-btn:hover {
    color: var(--belucookie-primary, #376e78);
}

.belucookie-expand-btn svg {
    width: 16px;
    height: 16px;
}

.belucookie-category.expanded .belucookie-expand-btn svg {
    transform: rotate(180deg);
}

.belucookie-category-description {
    color: #777;
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.4;
}

.belucookie-category-details {
    display: none;
    margin-top: 10px;
    padding: 10px;
    background: #f1f1f1;
    border-radius: 6px;
    font-size: 11px;
}

.belucookie-category.expanded .belucookie-category-details {
    display: block;
}

.belucookie-cookie-list {
    width: 100%;
    border-collapse: collapse;
}

.belucookie-cookie-list th {
    text-align: left;
    padding: 4px 6px;
    border-bottom: 1px solid #ddd;
    color: #666;
    font-weight: 600;
    font-size: 10px;
}

.belucookie-cookie-list td {
    padding: 4px 6px;
    border-bottom: 1px solid #eee;
    color: #777;
    font-size: 10px;
}

.belucookie-legal-basis {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
    font-style: italic;
}

@media (max-width: 480px) {
    .belucookie-banner.active {
        padding: 10px;
    }

    .belucookie-container {
        width: 100%;
        max-width: none;
    }

    .belucookie-main,
    .belucookie-settings {
        padding: 14px;
    }

    .belucookie-title {
        font-size: 16px;
    }

    .belucookie-text {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .belucookie-quick-toggles {
        padding: 8px 10px;
        gap: 4px 8px;
        margin-bottom: 10px;
    }

    .belucookie-quick-toggle-item {
        padding: 3px 0;
    }

    .belucookie-quick-toggle-label {
        font-size: 12px;
    }

    .belucookie-buttons {
        gap: 6px;
        margin-bottom: 8px;
    }

    .belucookie-btn {
        padding: 9px 10px;
        font-size: 12px;
    }

    .belucookie-footer {
        font-size: 11px;
        gap: 6px;
    }
}

@media (max-width: 380px) {
    .belucookie-banner.active {
        padding: 8px;
    }

    .belucookie-main,
    .belucookie-settings {
        padding: 12px;
    }

    .belucookie-title {
        font-size: 15px;
    }

    .belucookie-btn {
        padding: 10px 8px;
        font-size: 11px;
        min-height: 44px; /* Touch target */
    }

    .belucookie-categories {
        max-height: 200px;
    }

    /* Quick toggles single column on very small screens */
    .belucookie-quick-toggles {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .belucookie-quick-toggle-item {
        justify-content: space-between;
    }
}

/* Extra small screens (350px and below) */
@media (max-width: 360px) {
    .belucookie-banner.active {
        padding: 6px;
    }

    .belucookie-main,
    .belucookie-settings {
        padding: 10px;
    }

    .belucookie-title {
        font-size: 14px;
    }

    .belucookie-text {
        font-size: 11px;
    }

    .belucookie-btn {
        padding: 10px 6px;
        font-size: 10px;
    }

    .belucookie-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .belucookie-footer {
        font-size: 10px;
        gap: 4px;
    }

    .belucookie-quick-btn {
        padding: 8px 10px;
        font-size: 10px;
    }

    .belucookie-category-name {
        font-size: 12px;
    }

    .belucookie-category-description {
        font-size: 11px;
    }
}

/* Animation */
.belucookie-banner .belucookie-overlay {
    opacity: 0;
    will-change: opacity;
}

.belucookie-banner .belucookie-container {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    will-change: transform, opacity;
}

.belucookie-banner.active .belucookie-overlay {
    opacity: 1;
    transition: opacity 0.35s ease-out;
}

.belucookie-banner.active .belucookie-container {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease-out;
}

/* Placeholder for blocked content */
.belucookie-placeholder {
    position: relative;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 30px 16px;
    text-align: center;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.belucookie-placeholder-content {
    max-width: 300px;
}

.belucookie-placeholder-content p {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 13px;
}

.belucookie-placeholder-btn {
    padding: 10px 20px;
    background: var(--belucookie-primary, #376e78);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.belucookie-placeholder-btn:hover {
    opacity: 0.9;
}

.belucookie-placeholder.belucookie-placeholder-loaded {
    display: none;
}

/* Settings link (shortcode) */
.belucookie-settings-link {
    text-decoration: none !important;
    color: inherit;
    cursor: pointer;
}

.belucookie-settings-link:hover {
    opacity: 0.7;
}

/* Remove ALL focus/active outlines from banner elements */
.belucookie-banner button,
.belucookie-banner a,
.belucookie-banner input,
.belucookie-banner label {
    outline: none !important;
}

.belucookie-banner button:focus,
.belucookie-banner button:active,
.belucookie-banner button:focus-visible,
.belucookie-banner a:focus,
.belucookie-banner a:active,
.belucookie-banner a:focus-visible,
.belucookie-banner input:focus,
.belucookie-banner input:active,
.belucookie-banner label:focus,
.belucookie-banner label:active {
    outline: none !important;
    box-shadow: none !important;
    border-style: solid !important;
}

/* Scroll-Lock when banner is active (iOS Safari compatible) */
body.belucookie-scroll-lock {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Preserve scroll position on iOS */
body.belucookie-scroll-lock {
    top: var(--belucookie-scroll-position, 0);
}

/* Safe Area Support for iPhone Notch */
@supports (padding: env(safe-area-inset-bottom)) {
    .belucookie-banner.active {
        padding-bottom: calc(15px + env(safe-area-inset-bottom));
        padding-left: calc(15px + env(safe-area-inset-left));
        padding-right: calc(15px + env(safe-area-inset-right));
    }

    @media (max-width: 480px) {
        .belucookie-banner.active {
            padding-bottom: calc(10px + env(safe-area-inset-bottom));
        }
    }
}

/* Touch target area - larger clickable zone without visual change */
.belucookie-toggle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 46px;
    height: 44px;
    min-width: 46px;
    min-height: 44px;
}

.belucookie-expand-btn {
    min-width: 44px;
    min-height: 44px;
}

/* Prevent horizontal scroll */
.belucookie-container {
    overflow-x: hidden;
}

/* Cookie table responsive */
.belucookie-category-details {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.belucookie-cookie-list {
    min-width: 280px;
}

