/* This file is part of Moodle - http://moodle.org/
 *
 * Moodle is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Moodle is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Moodle. If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    local_advancedcookiemanager
 * @copyright  2026 Marcin Czaja (RoseaThemes, rosea.io)
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */

#acb-root,
#acb-root * {
    box-sizing: border-box;
}

#acb-root .acb-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    border: 0;
    padding: 0;
    white-space: nowrap;
    clip-path: inset(50%);
    clip: rect(0 0 0 0);
    overflow: hidden;
}

#acb-root .acb-banner {
    position: fixed;
    bottom: 24px;
    z-index: 30000;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #d9e2ee;
    box-shadow: 0 18px 45px rgba(15, 50, 92, 0.18);
    border-radius: 16px;
    padding: 20px;
    width: min(600px, calc(100vw - 48px));
}

#acb-root .acb-banner--center {
    left: 50%;
    transform: translateX(-50%);
}

#acb-root .acb-banner--left {
    left: 24px;
}

#acb-root .acb-banner--right {
    right: 24px;
}

#acb-root .acb-title {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

#acb-root .acb-description {
    margin: 0 0 12px;
    color: #39424d;
}

#acb-root .acb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

#acb-root .acb-banner .acb-btn-link[data-action="open-preferences"] {
    margin-left: auto;
}

#acb-root .acb-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
}

#acb-root .acb-actions .btn:focus-visible,
#acb-root .acb-btn-link:focus-visible,
#acb-root .acb-close:focus-visible,
#acb-root .acb-floating:focus-visible {
    outline: 2px solid #0f6cbf;
    outline-offset: 2px;
}

#acb-root .acb-actions .btn.btn-secondary.is-selected {
    background: #fff4e5;
    color: #7a3d00;
    border-color: #e2ad67;
    box-shadow: inset 0 0 0 1px rgba(226, 173, 103, 0.35);
}

#acb-root .acb-actions [data-role="btn-withdraw-consent"] {
    margin-left: auto;
}

#acb-root .acb-btn-link {
    appearance: none;
    border: 0;
    background: transparent;
    color: #0f6cbf;
    text-decoration: none;
    padding: 6px 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#acb-root .acb-modal {
    position: fixed;
    inset: 0;
    z-index: 30020;
}

#acb-root .acb-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 26, 40, 0.45);
}

#acb-root .acb-modal__panel {
    position: relative;
    z-index: 1;
    margin: 6vh auto;
    max-width: 760px;
    max-height: 88vh;
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #d9e2ee;
    box-shadow: 0 20px 60px rgba(15, 35, 60, 0.22);
}

[data-theme="dark"] #acb-root .acb-modal__panel {
    background: #1f2937;
    border-color: #374151;
}

#acb-root .acb-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

#acb-root .acb-modal__header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#acb-root .acb-close {
    appearance: none;
    border: 0;
    background: #eef2f6;
    color: #2a3442;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#acb-root .acb-close .fa {
    font-size: 22px;
    line-height: 1;
}

#acb-root .acb-close:hover {
    background: #e2e8f0;
    border-color: #b5c0cf;
}

#acb-root .acb-categories {
    display: grid;
    gap: 8px;
    margin: 12px 0;
    border: 0;
    padding: 0;
}

#acb-root .acb-legend {
    font-weight: 600;
    margin-bottom: 8px;
}

#acb-root .acb-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-radius: 8px;
    padding: 12px;
}

#acb-root .acb-category:hover {
    border-color: #b9cbe1;
}

#acb-root .acb-category small {
    display: block;
    color: #5e6b7a;
    margin-top: 4px;
}

#acb-root .acb-category__text {
    min-width: 0;
    flex: 1 1 auto;
}

#acb-root .acb-switch {
    position: relative;
    width: 46px;
    height: 26px;
    flex: 0 0 auto;
}

#acb-root .acb-switch input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

#acb-root .acb-switch__slider {
    position: absolute;
    inset: 0;
    background: #ccd6e2;
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

#acb-root .acb-switch__slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

#acb-root .acb-switch input:checked + .acb-switch__slider {
    background: #0f6cbf;
}

#acb-root .acb-switch input:checked + .acb-switch__slider::before {
    transform: translateX(20px);
}

#acb-root .acb-switch input:focus-visible + .acb-switch__slider {
    outline: 2px solid #0f6cbf;
    outline-offset: 2px;
}

#acb-root .acb-switch input:disabled + .acb-switch__slider {
    opacity: 0.7;
    cursor: not-allowed;
}

#acb-root .acb-legal {
    margin-top: 12px;
    padding-top: 10px;
}

#acb-root .acb-links-card {
    border: 1px solid #dfe8f3;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border-radius: 12px;
    padding: 10px;
    margin: 8px 0 10px;
}

#acb-root .acb-links-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5a6878;
    margin-bottom: 8px;
    font-weight: 700;
}

#acb-root .acb-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

#acb-root .acb-link-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #d7e4f2;
    background: #f4f8fd;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1f2c3a;
    text-decoration: none;
    min-height: 30px;
    line-height: 1;
    transition: all 0.18s ease;
}

#acb-root .acb-link-chip .fa {
    font-size: 0.84rem;
    color: #0f6cbf;
}

#acb-root .acb-link-chip:hover {
    background: #eaf3ff;
    border-color: #b7cee7;
}

#acb-root .acb-info-toggle {
    appearance: none;
    border: 1px solid #d7e4f2;
    background: #f4f8fd;
    color: #1f2c3a;
    border-radius: 999px;
    min-height: 30px;
    padding: 5px 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
    font-size: 0.78rem;
    cursor: pointer;
    font-weight: 600;
    line-height: 1;
    transition: all 0.18s ease;
}

#acb-root .acb-info-toggle:hover {
    background: #eaf3ff;
    border-color: #b7cee7;
}

#acb-root .acb-info-toggle__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f6cbf;
    line-height: 1;
}

#acb-root .acb-info-toggle__icon .fa {
    font-size: 0.86rem;
}

#acb-root .acb-info-toggle__label {
    font-weight: 600;
    letter-spacing: 0.01em;
}

#acb-root .acb-vendorinfo {
    white-space: pre-wrap;
    font-size: 0.81rem;
    color: #3f4d5d;
    background: #f6faff;
    border: 1px solid #dbe6f3;
    border-radius: 10px;
    padding: 10px;
    max-height: 220px;
    line-height: 1.45;
}

#acb-root .acb-floating-wrap {
    position: fixed;
    bottom: 24px;
    z-index: 1030;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#acb-root .acb-floating-wrap--left {
    left: 24px;
    right: auto;
}

#acb-root .acb-floating-wrap--center {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

#acb-root .acb-floating-wrap--right {
    left: auto;
    right: 24px;
}

#acb-root .acb-floating {
    border: 1px solid #111827;
    background: #111827;
    color: #f9fafb;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.32);
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    transition: all 150ms ease-out;
}

#acb-root .acb-floating__label {
    white-space: nowrap;
    display: inline-block;
    transition: max-width 0.2s ease, opacity 0.2s ease, margin-left 0.2s ease;
}

#acb-root .acb-floating--left,
#acb-root .acb-floating--center,
#acb-root .acb-floating--right {
    padding: 9px 12px;
}

#acb-root .acb-floating--left .acb-floating__label,
#acb-root .acb-floating--center .acb-floating__label,
#acb-root .acb-floating--right .acb-floating__label {
    max-width: 0;
    opacity: 0;
    margin-left: 0;
}

#acb-root .acb-floating--left:hover .acb-floating__label,
#acb-root .acb-floating--left:focus-visible .acb-floating__label,
#acb-root .acb-floating--center:hover .acb-floating__label,
#acb-root .acb-floating--center:focus-visible .acb-floating__label,
#acb-root .acb-floating--right:hover .acb-floating__label,
#acb-root .acb-floating--right:focus-visible .acb-floating__label {
    max-width: 180px;
    opacity: 1;
    margin-left: 4px;
}

#acb-root .acb-floating--left:hover,
#acb-root .acb-floating--left:focus-visible,
#acb-root .acb-floating--center:hover,
#acb-root .acb-floating--center:focus-visible,
#acb-root .acb-floating--right:hover,
#acb-root .acb-floating--right:focus-visible {
    padding-right: 14px;
}

#acb-root .acb-floating-dismiss {
    appearance: none;
    border: 0;
    background: #eef2f6;
    color: #2a3442;
    border-radius: 999px;
    min-height: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    cursor: pointer;
}

#acb-root .acb-floating-dismiss:hover {
    background: #e2e8f0;
}

#acb-root .acb-floating-dismiss__label {
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

#acb-root .acb-floating:hover {
    background: #1f2937;
    border-color: #1f2937;
}

#acb-root .acb-floating:focus,
#acb-root .acb-floating:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.acb-embed-placeholder {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 260px;
    max-height: min(78vh, 720px);
    overflow: hidden;
    display: flex;
    align-items: center;
    border: 1px solid #1f2430;
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(8, 11, 17, 0.84) 0%, rgba(8, 11, 17, 0.96) 100%),
        radial-gradient(120% 140% at 8% 12%, rgba(85, 110, 199, 0.22) 0%, rgba(85, 110, 199, 0) 58%),
        #090b0f;
    padding: 24px 26px;
    font-size: 0.95rem;
    color: #f3f5f9;
}

.acb-embed-placeholder__layout {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.acb-embed-placeholder__icon {
    width: 74px;
    height: 74px;
    border-radius: 20px;
    background: #f2f4f8;
    color: #11151d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.acb-embed-placeholder__icon .fa {
    font-size: 40px;
}

.acb-embed-placeholder__content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.acb-embed-placeholder__provider {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #c7d4e6;
    background: #eaf2ff;
    color: #1f3c6a;
    font-size: 0.75rem;
    font-weight: 600;
}

.acb-embed-placeholder__providerline {
    margin: 0 0 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.acb-embed-placeholder__message {
    margin: 0 0 14px;
    font-size: 0.95rem;
    line-height: 1.3;
    color: #f2f4fa;
    max-width: 52ch;
}

.acb-embed-placeholder__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.acb-embed-placeholder__actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    min-height: 34px;
    padding: 6px 12px;
}

.acb-embed-placeholder__actions .btn.btn-primary {
    background: #556ec7;
    border-color: #556ec7;
}

.acb-embed-placeholder__actions .btn.btn-secondary {
    background: transparent;
    border-color: transparent;
    color: #f5f7fb;
}

.acb-embed-placeholder__actions .btn.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.acb-embed-placeholder__actions .btn-link {
    text-decoration: none;
    padding-left: 0;
    padding-right: 0;
    color: #f5f7fb;
    font-weight: 700;
    font-size: 0.9rem;
}

.acb-embed-placeholder__actions .btn-link:hover {
    color: #ffffff;
}

#acb-root .acb-diagnostics {
    margin-top: 14px;
    padding-top: 12px;
}

#acb-root .acb-diagnostics__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#acb-root .acb-diagnostics__desc {
    margin: 8px 0 10px;
    font-size: 0.85rem;
    color: #5e6b7a;
}

#acb-root .acb-diagnostics__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

[data-bs-theme="dark"] #acb-root {
    --acb-dark-base: #27272c;
    --acb-dark-elev: #2f2f35;
    --acb-dark-surface: #34343b;
    --acb-dark-border: #4b4b56;
    --acb-dark-text: #ececf1;
    --acb-dark-muted: #b8b8c2;
}

[data-bs-theme="dark"] #acb-root .acb-banner {
    background: linear-gradient(180deg, var(--acb-dark-surface) 0%, var(--acb-dark-base) 100%);
    border-color: var(--acb-dark-border);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

[data-bs-theme="dark"] #acb-root .acb-title,
[data-bs-theme="dark"] #acb-root .acb-description,
[data-bs-theme="dark"] #acb-root .acb-legal p,
[data-bs-theme="dark"] #acb-root .acb-legend,
[data-bs-theme="dark"] #acb-root .acb-category__text strong {
    color: var(--acb-dark-text);
}

[data-bs-theme="dark"] #acb-root .acb-category small {
    color: var(--acb-dark-muted);
}

[data-bs-theme="dark"] #acb-root .acb-modal__panel {
    background: var(--acb-dark-base);
    border-color: var(--acb-dark-border);
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="dark"] #acb-root .acb-modal__backdrop {
    background: rgba(4, 10, 18, 0.68);
}

[data-bs-theme="dark"] #acb-root .acb-close {
    color: var(--acb-dark-text);
    background: var(--acb-dark-surface);
    border-color: var(--acb-dark-border);
}

[data-bs-theme="dark"] #acb-root .acb-close:hover {
    background: #3a3a43;
    border-color: #5a5a67;
}

[data-bs-theme="dark"] #acb-root .acb-category {
    border-color: var(--acb-dark-border);
    background: var(--acb-dark-surface);
}

[data-bs-theme="dark"] #acb-root .acb-category:hover {
    border-color: #666678;
}

[data-bs-theme="dark"] #acb-root .acb-switch__slider {
    background: #5a5a69;
}

[data-bs-theme="dark"] #acb-root .acb-switch input:checked + .acb-switch__slider {
    background: #2f8cff;
}

[data-bs-theme="dark"] #acb-root .acb-links-card {
    border-color: var(--acb-dark-border);
    background: linear-gradient(180deg, var(--acb-dark-surface) 0%, var(--acb-dark-base) 100%);
}

[data-bs-theme="dark"] #acb-root .acb-links-title {
    color: var(--acb-dark-muted);
}

[data-bs-theme="dark"] #acb-root .acb-link-chip,
[data-bs-theme="dark"] #acb-root .acb-info-toggle {
    background: var(--acb-dark-surface);
    border-color: var(--acb-dark-border);
    color: var(--acb-dark-text);
}

[data-bs-theme="dark"] #acb-root .acb-link-chip:hover,
[data-bs-theme="dark"] #acb-root .acb-info-toggle:hover {
    background: #3b3b45;
    border-color: #666678;
}

[data-bs-theme="dark"] #acb-root .acb-link-chip .fa,
[data-bs-theme="dark"] #acb-root .acb-info-toggle__icon {
    color: #6eb0ff;
}

[data-bs-theme="dark"] #acb-root .acb-vendorinfo {
    background: #222227;
    border-color: var(--acb-dark-border);
    color: #d7d7e0;
}

[data-bs-theme="dark"] #acb-root .acb-btn-link {
    color: #7eb8ff;
}

[data-bs-theme="dark"] #acb-root .acb-btn-link:hover {
    color: #a3ccff;
}

[data-bs-theme="dark"] #acb-root .acb-actions .btn.btn-secondary.is-selected {
    background: #604018;
    color: #ffe2ba;
    border-color: #a66a26;
    box-shadow: inset 0 0 0 1px rgba(235, 167, 83, 0.35);
}

[data-bs-theme="dark"] #acb-root .acb-actions [data-role="btn-withdraw-consent"] {
    border-color: #b86464;
}

[data-bs-theme="dark"] #acb-root .acb-floating-dismiss {
    color: var(--acb-dark-text);
    background: var(--acb-dark-surface);
    border-color: var(--acb-dark-border);
}

[data-bs-theme="dark"] #acb-root .acb-floating-dismiss:hover {
    background: #3a3a43;
}

[data-bs-theme="dark"] .acb-embed-placeholder {
    border-color: var(--acb-dark-border);
    background:
        linear-gradient(180deg, rgba(8, 11, 17, 0.84) 0%, rgba(8, 11, 17, 0.96) 100%),
        radial-gradient(120% 140% at 8% 12%, rgba(90, 124, 235, 0.2) 0%, rgba(90, 124, 235, 0) 60%),
        #090b0f;
    color: #f3f5f9;
}

[data-bs-theme="dark"] .acb-embed-placeholder__provider {
    background: #263248;
    border-color: #41506b;
    color: #d7e7ff;
}

[data-bs-theme="dark"] .acb-embed-placeholder__icon {
    background: #f2f4f8;
    color: #11151d;
}

[data-bs-theme="dark"] .acb-embed-placeholder__providerline,
[data-bs-theme="dark"] .acb-embed-placeholder__message {
    color: #f3f5f9;
}

[data-bs-theme="dark"] #acb-root .acb-diagnostics__desc {
    color: var(--acb-dark-muted);
}

@media (max-width: 768px) {
    .acb-embed-placeholder {
        border-radius: 20px;
        min-height: 220px;
        max-height: none;
        padding: 14px 14px;
    }

    .acb-embed-placeholder__layout {
        gap: 12px;
    }

    .acb-embed-placeholder__icon {
        width: 58px;
        height: 58px;
        border-radius: 16px;
    }

    .acb-embed-placeholder__icon .fa {
        font-size: 30px;
    }

    .acb-embed-placeholder__message {
        font-size: 1rem;
    }

    .acb-embed-placeholder__providerline {
        font-size: 0.75rem;
    }

    .acb-embed-placeholder__actions .btn,
    .acb-embed-placeholder__actions .btn-link {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    #acb-root .acb-banner {
        left: 10px;
        right: 10px;
        width: auto;
        transform: none;
        bottom: 10px;
        padding: 14px;
    }

    #acb-root .acb-modal__panel {
        margin: 2vh 8px;
    }

    #acb-root .acb-floating-wrap {
        bottom: 10px;
    }

    #acb-root .acb-floating-wrap--left {
        left: 10px;
        right: auto;
    }

    #acb-root .acb-floating-wrap--center {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    #acb-root .acb-floating-wrap--right {
        left: auto;
        right: 10px;
    }
}
