/*
 * Copyright (c) 2026 Philip Necsulescu.
 * All rights reserved.
 */

.cookie-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 16px;
    border: 3px solid var(--accent);
    border-radius: 0;
    background: var(--panel-bright);
    color: var(--accent-dark);
    font: inherit;
    font-weight: 700;
    line-height: 20px;
    text-decoration: none;
    cursor: pointer;
}

.cookie-action-button:hover,
.cookie-action-button:focus-visible {
    background: var(--ball-dot-yellow);
    color: var(--ink);
    outline: none;
}

.cookie-action-button--primary {
    background: var(--accent);
    color: #ffffff;
}

.cookie-action-button--secondary {
    border-color: var(--ball-dot-blue);
    color: var(--ball-dot-blue);
}

.cookie-banner[hidden],
.cookie-preferences-panel[hidden],
.cookie-preferences-link[hidden] {
    display: none;
}

.cookie-banner {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 1000;
    display: flex;
    justify-content: center;
}

.cookie-banner-content {
    display: flex;
    gap: 24px;
    align-items: center;
    width: min(960px, 100%);
    padding: 20px;
    border: 4px solid var(--accent);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 24px 60px var(--shadow-strong);
}

.cookie-banner-copy-content {
    flex: 1 1 520px;
    min-width: 0;
}

.cookie-banner h2,
.cookie-preferences-panel h2 {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 24px;
}

.cookie-banner p,
.cookie-preferences-panel p,
.cookie-radio-option {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 24px;
}

.cookie-policy-link {
    display: inline-flex;
    margin-top: 8px;
    color: var(--accent-dark);
    font-weight: 700;
}

.cookie-banner-actions,
.cookie-preferences-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.cookie-preferences-panel {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: grid;
    align-items: center;
    justify-items: center;
    padding: 24px;
    background: rgba(17, 17, 17, 0.46);
}

.cookie-preferences-panel-content {
    width: min(640px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 24px;
    border: 4px solid var(--accent);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 24px 60px var(--shadow-strong);
}

.cookie-preferences-panel-heading-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
}

.cookie-preferences-close {
    min-height: 36px;
    padding: 4px 12px;
    border: 2px solid var(--accent-divider);
    border-radius: 0;
    background: var(--panel-soft);
    color: var(--accent-dark);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.cookie-preferences-close:hover,
.cookie-preferences-close:focus-visible {
    background: var(--ball-dot-yellow);
    color: var(--ink);
    outline: none;
}

.cookie-preferences-fieldset {
    display: grid;
    gap: 8px;
    margin: 24px 0 0;
    padding: 16px;
    border: 2px solid var(--accent-divider);
}

.cookie-preferences-fieldset legend {
    padding: 0 8px;
    color: var(--ink);
    font-weight: 800;
}

.cookie-radio-option {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.cookie-radio-option input {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: var(--accent);
}

.cookie-preferences-status-content {
    display: grid;
    gap: 8px;
    margin-top: 20px;
    padding: 16px;
    background: var(--panel-soft);
    border: 2px solid var(--accent-divider);
}

.cookie-preferences-actions {
    margin-top: 20px;
}

.cookie-preferences-link {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 999;
    min-height: 36px;
    padding: 6px 12px;
    border: 2px solid var(--accent);
    border-radius: 0;
    background: var(--panel);
    color: var(--accent-dark);
    font: inherit;
    font-weight: 700;
    box-shadow: 0 8px 24px var(--shadow-soft);
    cursor: pointer;
}

.cookie-preferences-link:hover,
.cookie-preferences-link:focus-visible {
    background: var(--ball-dot-yellow);
    color: var(--ink);
    outline: none;
}

@media (max-width: 800px) {
    .cookie-action-button,
    .cookie-preferences-close,
    .cookie-banner p,
    .cookie-preferences-panel p,
    .cookie-radio-option,
    .cookie-policy-link,
    .cookie-preferences-link {
        font-size: var(--mobile-body-font-size);
        line-height: var(--mobile-body-line-height);
    }
}

@media (max-width: 640px) {
    .cookie-banner {
        right: 8px;
        bottom: 8px;
        left: 8px;
    }

    .cookie-banner-content,
    .cookie-preferences-panel-heading-content {
        flex-direction: column;
    }

    .cookie-banner-content {
        align-items: stretch;
        gap: 16px;
        padding: 16px;
    }

    .cookie-banner-actions,
    .cookie-preferences-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-action-button {
        width: 100%;
    }

    .cookie-preferences-panel {
        padding: 12px;
    }

    .cookie-preferences-panel-content {
        max-height: calc(100vh - 24px);
        padding: 20px;
    }

    .cookie-preferences-link {
        right: 8px;
        bottom: 8px;
    }
}
