/*
 * This file is part of WSC Sulu Orestbida Cookie Consent Bundle.
 *
 * (c) Christian Säum <Christian.Saeum@Web-SEO-Consulting.eu> - Web-SEO-Consulting.eu
 *
 * This source file is subject to the GNU Affero General Public License v3
 * that is bundled with this source code in the file LICENSE.
 */

/*
 * Layout additions to the CookieConsent library, loaded after cookieconsent.css.
 * All styling of the service details lives here: the frontend script generates no
 * style attributes, which a strict CSP without 'unsafe-inline' would block.
 */

/* Service name on its own line */
#cc-main .wsc-cc-service__title {
    display: block;
    font-weight: 600;
}

/* Text uses the full width instead of the icon column */
#cc-main .pm__service-icon {
    display: none;
}

#cc-main .pm__service {
    padding-left: 0.4em;
}

#cc-main .wsc-cc-service {
    font-size: 0.9em;
    margin-top: 8px;
}

#cc-main .wsc-cc-service__description,
#cc-main .wsc-cc-service__details {
    margin: 8px 0;
}

#cc-main .wsc-cc-service__details {
    list-style: disc;
    padding-left: 20px;
}

#cc-main .wsc-cc-service__cookies {
    margin-top: 12px;
}

#cc-main .wsc-cc-table {
    border-collapse: collapse;
    font-size: 0.85em;
    margin-top: 6px;
    width: 100%;
}

#cc-main .wsc-cc-table th,
#cc-main .wsc-cc-table td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 6px;
    text-align: left;
    vertical-align: top;
}

#cc-main .wsc-cc-table thead tr {
    background: rgba(0, 0, 0, 0.05);
}

#cc-main .wsc-cc-table code {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    padding: 2px 4px;
}

/*
 * Floating settings button (outside of #cc-main). The colors come from the CSS variables of the
 * library and the theme stylesheet on :root, the position from a modifier class: no inline style.
 */
.wsc-cc-settings-button {
    align-items: center;
    background: var(--cc-btn-primary-bg, #30363c);
    border: 0;
    border-radius: 50%;
    bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: var(--cc-btn-primary-color, #fff);
    cursor: pointer;
    display: flex;
    font-size: 24px;
    height: 48px;
    justify-content: center;
    position: fixed;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 48px;
    z-index: 2147483646;
}

.wsc-cc-settings-button:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.wsc-cc-settings-button:focus-visible,
.wsc-consent-preferences-link:focus-visible {
    outline: 3px solid var(--cc-btn-primary-bg, #30363c);
    outline-offset: 3px;
}

.wsc-cc-settings-button--bottom-left {
    left: 20px;
}

.wsc-cc-settings-button--bottom-right {
    right: 20px;
}

.wsc-cc-settings-button--top-left {
    bottom: auto;
    left: 20px;
    top: 20px;
}

.wsc-cc-settings-button--top-right {
    bottom: auto;
    right: 20px;
    top: 20px;
}

.wsc-consent-preferences-link {
    cursor: pointer;
}

/*
 * Placeholder of wsc_consent_iframe(): shown instead of the iframe until the category is accepted.
 * The hidden attribute (set by the script) must win over the display value.
 */
.wsc-consent-iframe iframe {
    border: 0;
    max-width: 100%;
    width: 100%;
}

.wsc-consent-iframe__placeholder {
    align-items: center;
    background: #f4f4f5;
    border: 1px dashed #b4b4bb;
    border-radius: 8px;
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    min-height: 160px;
    padding: 24px;
    text-align: center;
}

.wsc-consent-iframe__placeholder[hidden] {
    display: none;
}

.wsc-consent-iframe__text {
    margin: 0;
}

.wsc-consent-iframe__button {
    background: var(--cc-btn-primary-bg, #30363c);
    border: 0;
    border-radius: 6px;
    color: var(--cc-btn-primary-color, #fff);
    cursor: pointer;
    font: inherit;
    padding: 10px 20px;
}

.wsc-consent-iframe__button:focus-visible {
    outline: 3px solid var(--cc-btn-primary-bg, #30363c);
    outline-offset: 3px;
}
