/* Cookie Consent Banner */
.cc-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 999999;
    background: var(--cc-bg, #fff);
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.15);
    padding: 1.25rem 1.5rem calc(1.25rem + env(safe-area-inset-bottom));
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--cc-text, #333);
}

.cc-position-top {
    top: 0;
}

.cc-position-bottom {
    bottom: 0;
}

#cc-banner[hidden],
#cc-settings[hidden],
#cc-reopen[hidden] {
    display: none !important;
}

.cc-position-bottom {
    bottom: 0;
}

.cc-position-center {
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    max-width: 600px;
    width: 90%;
    border-radius: 8px;
}

.cc-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.cc-banner-text {
    margin-bottom: 1rem;
}

.cc-banner-text h2 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.cc-banner-text p {
    margin: 0;
}

.cc-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-bottom: 0.5rem;
}

.cc-privacy-link {
    font-size: 0.8rem;
    color: #666;
    text-decoration: underline;
}

.cc-banner-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}

/* Buttons */
.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border: 1px solid var(--cc-primary, #334155);
    border-radius: var(--cc-radius, 4px);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    color: var(--cc-text, #172033);
    background: var(--cc-bg, #fff);
    transition: background-color 0.2s, box-shadow 0.2s;
}

.cc-banner-actions .cc-btn {
    flex: 1 1 12rem;
}

.cc-btn-save {
    border-color: var(--cc-primary, #334155);
    color: var(--cc-text, #172033);
    background: var(--cc-bg, #fff);
}

.cc-btn:hover {
    background: rgba(128, 128, 128, 0.12);
}

.cc-btn:focus-visible,
.cc-settings-close:focus-visible,
.cc-reopen:focus-visible,
.cc-accept-category:focus-visible {
    outline: 3px solid var(--cc-primary, #1d4ed8);
    outline-offset: 3px;
}

/* Settings Modal */
.cc-settings {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cc-settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.cc-settings-inner {
    position: relative;
    background: var(--cc-bg, #fff);
    border-radius: var(--cc-radius, 8px);
    max-width: 550px;
    width: 90%;
    max-height: min(80vh, 48rem);
    max-height: min(80dvh, 48rem);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.9rem;
    color: var(--cc-text, #333);
}

.cc-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.cc-settings-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.cc-settings-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    min-width: 44px;
    min-height: 44px;
    padding: 0.25rem 0.5rem;
}

.cc-settings-body {
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.cc-settings-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.cc-settings-footer .cc-btn {
    flex: 1 1 9rem;
}

/* Categories */
.cc-saved-at {
    margin: 0 0 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.8rem;
    color: #666;
}

.cc-status {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--cc-radius, 4px);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--cc-text, #333);
}

.cc-category {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.cc-category:last-child {
    border-bottom: none;
}

.cc-category-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.cc-category-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--cc-primary, #2563eb);
}

.cc-category-desc {
    margin: 0.25rem 0 0 1.6rem;
    font-size: 0.8rem;
    color: #666;
}

.cc-category-providers {
    margin: 0.15rem 0 0 1.6rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.cc-always-on {
    font-weight: normal;
    font-size: 0.8rem;
    color: #16a34a;
}

/* Blocked content placeholder */
.cc-blocked-content {
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin: 1rem 0;
}

.cc-blocked-message {
    margin: 0 0 1rem 0;
    color: #666;
}

/* Reopen button */
.cc-reopen {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 999998;
    min-width: 44px;
    min-height: 44px;
    max-width: min(12rem, calc(100vw - 2rem));
    padding: 0.65rem 0.9rem;
    border-radius: var(--cc-radius, 999px);
    border: 1px solid var(--cc-primary, #334155);
    background: var(--cc-bg, #fff);
    color: var(--cc-text, #172033);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s;
}

.cc-reopen.cc-reopen-right {
    left: auto;
    right: 1rem;
}

.cc-accept-category {
    min-width: 44px;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border: 1px solid var(--cc-primary, #334155);
    border-radius: var(--cc-radius, 4px);
    color: var(--cc-text, #172033);
    background: var(--cc-bg, #fff);
    font-weight: 600;
    cursor: pointer;
}

.cc-accept-category:hover {
    background: rgba(128, 128, 128, 0.12);
}

@media (prefers-reduced-motion: reduce) {
    .cc-btn,
    .cc-reopen {
        transition: none;
    }
}

.cc-reopen:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Responsive */
@media (max-width: 640px) {
    .cc-banner {
        padding: 1rem;
    }

    .cc-banner-actions {
        flex-direction: column;
    }

    .cc-btn {
        width: 100%;
    }

    .cc-settings-footer {
        flex-direction: column;
    }

    .cc-settings-footer .cc-btn {
        width: 100%;
    }
}
