/**
 * Cookie Consent Banner - Public Styles
 *
 * @package CookieConsentBanner
 * @since   1.0.0
 */

/* ==========================================================================
   1. Banner Base
   ========================================================================== */

.ccb-banner {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    z-index: var(--ccb-z-index, 999999);
    box-sizing: border-box;
    font-family: var(--ccb-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);
    font-size: var(--ccb-font-size, 14px);
    line-height: 1.5;
    color: var(--ccb-text-color, #333333);
    background-color: var(--ccb-bg-color, #ffffff);
    border-color: var(--ccb-border-color, #e5e5e5);
}

.ccb-banner *,
.ccb-banner *::before,
.ccb-banner *::after {
    box-sizing: border-box;
}

/* ==========================================================================
   2. Banner Positions
   ========================================================================== */

.ccb-position-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-top: 1px solid var(--ccb-border-color, #e5e5e5);
}

.ccb-position-top {
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-bottom: 1px solid var(--ccb-border-color, #e5e5e5);
}

.ccb-position-bottom-left {
    bottom: 20px;
    left: 20px;
    right: auto;
    max-width: 420px;
    border: 1px solid var(--ccb-border-color, #e5e5e5);
    border-radius: 12px;
}

.ccb-position-bottom-right {
    bottom: 20px;
    right: 20px;
    left: auto;
    max-width: 420px;
    border: 1px solid var(--ccb-border-color, #e5e5e5);
    border-radius: 12px;
}

.ccb-position-center {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: var(--ccb-overlay-color, rgba(0, 0, 0, 0.5));
}

.ccb-position-center .ccb-banner-inner {
    max-width: 560px;
    width: 90%;
    border-radius: 12px;
    border: 1px solid var(--ccb-border-color, #e5e5e5);
    background-color: var(--ccb-bg-color, #ffffff);
}

.ccb-banner.ccb-has-shadow {
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.ccb-position-bottom-left.ccb-has-shadow,
.ccb-position-bottom-right.ccb-has-shadow {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   3. Banner Inner Layout (3-column: logo | content | buttons)
   ========================================================================== */

.ccb-banner-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 22px 32px;
    max-width: var(--ccb-max-width, 100%);
    margin: 0 auto;
}

.ccb-position-bottom-left .ccb-banner-inner,
.ccb-position-bottom-right .ccb-banner-inner,
.ccb-position-center .ccb-banner-inner {
    flex-direction: column;
    align-items: stretch;
}

/* ==========================================================================
   3a. Banner Logo
   ========================================================================== */

.ccb-banner-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ccb-banner-logo-icon {
    width: 42px;
    height: 42px;
    color: var(--ccb-btn-accept-bg, #8b6914);
    opacity: 0.85;
}

.ccb-position-bottom-left .ccb-banner-logo,
.ccb-position-bottom-right .ccb-banner-logo,
.ccb-position-center .ccb-banner-logo {
    align-self: flex-start;
}

/* ==========================================================================
   3b. Banner Content
   ========================================================================== */

.ccb-banner-content {
    flex: 1;
    min-width: 0;
}

.ccb-banner-title {
    margin: 0 0 6px 0;
    font-size: 1.1em;
    font-weight: 700;
    line-height: 1.3;
    color: inherit;
}

.ccb-banner-description {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: inherit;
    opacity: 0.8;
}

.ccb-banner-links {
    display: inline-flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.ccb-banner-links a {
    color: var(--ccb-btn-accept-bg, #8b6914);
    text-decoration: underline;
    font-size: 13px;
    font-weight: 500;
}

.ccb-banner-links a:hover {
    text-decoration: none;
}

/* ==========================================================================
   4. Banner Actions / Buttons (stacked vertically on right)
   ========================================================================== */

.ccb-banner-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex-shrink: 0;
    min-width: 320px;
}

.ccb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 24px;
    border-radius: var(--ccb-btn-border-radius, 4px);
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    border: 2px solid transparent;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    text-align: center;
}

.ccb-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 105, 20, 0.3);
}

.ccb-btn:hover {
    opacity: 0.88;
}

/* Accept - filled solid button */
.ccb-btn-accept {
    background-color: var(--ccb-btn-accept-bg, #8b6914);
    color: var(--ccb-btn-accept-text, #ffffff);
    border-color: var(--ccb-btn-accept-border, #8b6914);
    font-weight: var(--ccb-btn-accept-weight, 600);
}

/* Reject - same prominence as accept (no dark patterns) */
.ccb-btn-reject {
    background-color: var(--ccb-btn-reject-bg, #8b6914);
    color: var(--ccb-btn-reject-text, #ffffff);
    border-color: var(--ccb-btn-reject-border, #8b6914);
    font-weight: var(--ccb-btn-reject-weight, 600);
}

/* Preferences - outlined button */
.ccb-btn-preferences {
    background-color: var(--ccb-btn-pref-bg, transparent);
    color: var(--ccb-btn-pref-text, #8b6914);
    border-color: var(--ccb-btn-pref-border, #8b6914);
    font-weight: var(--ccb-btn-pref-weight, 500);
}

.ccb-btn-preferences:hover {
    background-color: rgba(139, 105, 20, 0.06);
}

.ccb-position-bottom-left .ccb-banner-actions,
.ccb-position-bottom-right .ccb-banner-actions,
.ccb-position-center .ccb-banner-actions {
    flex-direction: column;
    min-width: 0;
}

.ccb-position-bottom-left .ccb-btn,
.ccb-position-bottom-right .ccb-btn,
.ccb-position-center .ccb-btn {
    width: 100%;
}

/* ==========================================================================
   4a. Banner Footer (branding + personalize link)
   ========================================================================== */

.ccb-banner-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 32px;
    border-top: 1px solid var(--ccb-border-color, #e5e5e5);
    font-size: 12px;
    color: #999999;
}

.ccb-banner-branding {
    font-size: 11px;
    color: #aaaaaa;
    letter-spacing: 0.2px;
}

.ccb-banner-personalize {
    color: var(--ccb-btn-accept-bg, #8b6914);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.ccb-banner-personalize:hover {
    text-decoration: underline;
}

/* ==========================================================================
   5. Banner Animations
   ========================================================================== */

.ccb-animate-slide.ccb-position-bottom {
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ccb-animate-slide.ccb-position-top {
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ccb-animate-slide.ccb-position-bottom-left,
.ccb-animate-slide.ccb-position-bottom-right {
    transform: translateY(40px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.ccb-animate-slide.ccb-visible.ccb-position-bottom,
.ccb-animate-slide.ccb-visible.ccb-position-top {
    transform: translateY(0);
}

.ccb-animate-slide.ccb-visible.ccb-position-bottom-left,
.ccb-animate-slide.ccb-visible.ccb-position-bottom-right {
    transform: translateY(0);
    opacity: 1;
}

.ccb-animate-fade {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.ccb-animate-fade.ccb-visible {
    opacity: 1;
}

.ccb-banner.ccb-visible {
    display: block !important;
}

.ccb-position-center.ccb-visible {
    display: flex !important;
}

/* ==========================================================================
   6. Preferences Modal (Cookiebot-style 3-tab layout)
   ========================================================================== */

.ccb-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: calc(var(--ccb-z-index, 999999) + 1);
    align-items: center;
    justify-content: center;
}

.ccb-modal.ccb-modal-open {
    display: flex !important;
}

.ccb-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.45);
}

/* Main modal card */
.ccb-modal-content.ccb-modal-tabbed {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 0;
    max-width: 900px;
    width: 96%;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

/* Header bar: logo + branding + close */
.ccb-modal-header-bar {
    display: flex;
    align-items: center;
    padding: 18px 28px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
    gap: 12px;
}

.ccb-modal-logo {
    color: #8b6914;
    display: flex;
    align-items: center;
}

.ccb-modal-branding {
    flex: 1;
}

.ccb-modal-brand-name {
    font-size: 20px;
    font-weight: 700;
    color: #1d2327;
    letter-spacing: -0.3px;
}

.ccb-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    color: #666666;
    flex-shrink: 0;
    transition: background-color 0.15s ease;
}

.ccb-modal-close:hover {
    background-color: #f0f0f0;
}

.ccb-modal-close:focus-visible {
    outline: 2px solid #8b6914;
    outline-offset: 2px;
}

.ccb-modal-close svg {
    width: 18px;
    height: 18px;
}

/* Tab Navigation */
.ccb-modal-tabs {
    display: flex;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
    padding: 0 28px;
}

.ccb-modal-tab {
    flex: 1;
    padding: 14px 8px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: #666666;
    cursor: pointer;
    text-align: center;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.ccb-modal-tab:hover {
    color: #1d2327;
}

.ccb-modal-tab.active {
    color: #1d2327;
    font-weight: 600;
    border-bottom-color: #8b6914;
}

/* Tab Panels */
.ccb-modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.ccb-tab-panel {
    display: none;
    padding: 28px 32px;
}

.ccb-tab-panel.active {
    display: block;
}

.ccb-tab-title {
    margin: 0 0 14px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #1d2327;
}

.ccb-tab-text {
    font-size: 14px;
    line-height: 1.7;
    color: #444444;
}

.ccb-about-text {
    font-size: 14px;
    line-height: 1.75;
    color: #444444;
}

/* Declaration date at bottom of Details tab */
.ccb-declaration-date {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
    font-size: 13px;
    color: #8c8f94;
}

.ccb-declaration-date strong {
    color: #1d2327;
}

/* Sticky Footer Buttons */
.ccb-modal-footer {
    border-top: 1px solid #e5e5e5;
    flex-shrink: 0;
    padding: 0;
}

.ccb-footer-buttons {
    display: none;
    gap: 12px;
    padding: 18px 28px;
}

.ccb-footer-buttons.active {
    display: flex;
}

.ccb-footer-buttons .ccb-btn {
    flex: 1;
    min-width: 0;
    padding: 13px 24px;
    font-size: 15px;
    text-align: center;
}

.ccb-btn-customize {
    background: transparent;
    color: var(--ccb-btn-pref-text, #8b6914);
    border-color: var(--ccb-btn-pref-border, #c3c4c7);
}

.ccb-btn-customize:hover {
    border-color: var(--ccb-btn-pref-text, #8b6914);
}

/* Always active label */
.ccb-always-active-label {
    font-size: 12px;
    color: #16a34a;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-right: 8px;
    white-space: nowrap;
}

/* ==========================================================================
   7. Cookie Categories (Details tab)
   ========================================================================== */

.ccb-category {
    border-bottom: 1px solid #e8e8e8;
    padding: 0;
}

.ccb-category:last-child {
    border-bottom: none;
}

.ccb-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    background: none;
    border: none;
    width: 100%;
    padding: 18px 0;
    font: inherit;
    color: inherit;
    text-align: left;
}

.ccb-category-header:focus-visible {
    outline: 2px solid #8b6914;
    outline-offset: 2px;
    border-radius: 4px;
}

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

.ccb-category-chevron {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #333333;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
}

.ccb-category.ccb-category-open .ccb-category-chevron {
    transform: rotate(180deg);
}

.ccb-category-name {
    font-weight: 700;
    font-size: 15px;
    color: #1d2327;
}

.ccb-category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    background-color: #f0f0f0;
    color: #555555;
    line-height: 1;
}

.ccb-category-toggle-area {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ccb-category-desc {
    margin: 0 0 12px 0;
    padding: 0 0 0 26px;
    font-size: 14px;
    line-height: 1.65;
    color: #555555;
}

.ccb-category-details {
    display: none;
    padding: 0 0 16px 0;
}

.ccb-category.ccb-category-open .ccb-category-details {
    display: block;
}

/* ==========================================================================
   8. Cookie Table
   ========================================================================== */

.ccb-cookie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 8px;
}

.ccb-cookie-table th,
.ccb-cookie-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.ccb-cookie-table th {
    font-weight: 600;
    color: #555555;
    background-color: #fafafa;
    white-space: nowrap;
}

.ccb-cookie-table td {
    color: #666666;
    word-break: break-word;
}

.ccb-cookie-table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   9. Toggle Switch
   ========================================================================== */

.ccb-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.ccb-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.ccb-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cccccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background-color 0.25s ease;
}

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

.ccb-toggle input:checked + .ccb-toggle-slider {
    background-color: #8b6914;
}

.ccb-toggle input:checked + .ccb-toggle-slider::before {
    transform: translateX(20px);
}

.ccb-toggle input:disabled + .ccb-toggle-slider {
    background-color: #c9a84c;
    cursor: default;
    opacity: 0.7;
}

.ccb-toggle input:disabled + .ccb-toggle-slider::before {
    transform: translateX(20px);
}

.ccb-toggle input:focus-visible + .ccb-toggle-slider {
    box-shadow: 0 0 0 3px rgba(139, 105, 20, 0.3);
}

/* ==========================================================================
   10. Floating Button
   ========================================================================== */

.ccb-floating-btn {
    display: none;
    position: fixed;
    z-index: var(--ccb-z-index, 999999);
    width: var(--ccb-floating-size, 48px);
    height: var(--ccb-floating-size, 48px);
    border-radius: 50%;
    border: none;
    background-color: var(--ccb-floating-bg, #8b6914);
    color: var(--ccb-floating-color, #ffffff);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ccb-floating-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.ccb-floating-btn:focus-visible {
    outline: 2px solid #8b6914;
    outline-offset: 3px;
}

.ccb-floating-btn.ccb-floating-visible {
    display: flex;
}

.ccb-floating-btn svg {
    width: 22px;
    height: 22px;
}

.ccb-floating-bottom-left {
    bottom: 20px;
    left: 20px;
}

.ccb-floating-bottom-right {
    bottom: 20px;
    right: 20px;
}

/* ==========================================================================
   11. Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .ccb-banner-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 18px 20px;
        gap: 16px;
    }

    .ccb-banner-logo {
        align-self: flex-start;
    }

    .ccb-banner-actions {
        min-width: 0;
        flex-direction: column;
    }

    .ccb-banner-actions .ccb-btn {
        width: 100%;
    }

    .ccb-banner-footer {
        padding: 8px 20px;
    }

    .ccb-modal-content.ccb-modal-tabbed {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .ccb-modal-header-bar {
        padding: 14px 18px;
    }

    .ccb-modal-tabs {
        padding: 0 18px;
    }

    .ccb-modal-tab {
        font-size: 13px;
        padding: 12px 4px;
    }

    .ccb-tab-panel {
        padding: 20px 18px;
    }

    .ccb-footer-buttons {
        padding: 14px 18px;
        flex-direction: column;
    }

    .ccb-banner-title {
        font-size: 1.05em;
    }

    .ccb-banner-description {
        font-size: 12px;
    }

    .ccb-category-name {
        font-size: 14px;
    }
}

/* ==========================================================================
   12. Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .ccb-animate-slide,
    .ccb-animate-fade,
    .ccb-toggle-slider,
    .ccb-toggle-slider::before,
    .ccb-floating-btn,
    .ccb-category-chevron {
        transition: none;
    }
}

/* ==========================================================================
   13. Accessibility - Focus Indicators
   ========================================================================== */

.ccb-banner a:focus-visible,
.ccb-modal a:focus-visible {
    outline: 2px solid #8b6914;
    outline-offset: 2px;
    border-radius: 2px;
}

.ccb-category-header:focus-visible,
.ccb-btn:focus-visible,
.ccb-modal-close:focus-visible,
.ccb-floating-btn:focus-visible,
.ccb-toggle input:focus-visible + .ccb-toggle-slider {
    outline: 2px solid #8b6914;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (forced-colors: active) {
    .ccb-btn {
        border: 2px solid ButtonText;
    }

    .ccb-toggle-slider {
        border: 1px solid ButtonText;
    }

    .ccb-modal-content {
        border: 1px solid CanvasText;
    }
}

/* ==========================================================================
   14. Compliance - "Do Not Sell" Link (CCPA)
   ========================================================================== */

.ccb-do-not-sell-link {
    display: block;
    color: var(--ccb-btn-accept-bg, #8b6914);
    text-decoration: underline;
    font-size: 12px;
    text-align: center;
    padding: 4px 0;
    cursor: pointer;
}

.ccb-do-not-sell-link:hover {
    text-decoration: none;
}

/* ==========================================================================
   15. RTL Support (Arabic, Hebrew, Farsi, Urdu)
   ========================================================================== */

[dir="rtl"] .ccb-banner-inner,
[dir="rtl"] .ccb-modal-header,
[dir="rtl"] .ccb-modal-body,
[dir="rtl"] .ccb-modal-footer {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .ccb-category-header {
    text-align: right;
}

[dir="rtl"] .ccb-toggle-slider::before {
    left: auto;
    right: 3px;
}

[dir="rtl"] .ccb-toggle input:checked + .ccb-toggle-slider::before {
    transform: translateX(-20px);
}

[dir="rtl"] .ccb-toggle input:disabled + .ccb-toggle-slider::before {
    transform: translateX(-20px);
}

[dir="rtl"] .ccb-floating-bottom-left {
    left: auto;
    right: 20px;
}

[dir="rtl"] .ccb-floating-bottom-right {
    right: auto;
    left: 20px;
}

[dir="rtl"] .ccb-banner-links {
    direction: rtl;
}

[dir="rtl"] .ccb-category-chevron {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .ccb-banner-footer {
    direction: rtl;
}

/* ==========================================================================
   16. Compliance - Notice Only Mode
   ========================================================================== */

.ccb-consent-notice .ccb-banner-actions {
    justify-content: center;
}

.ccb-consent-notice .ccb-btn-ok {
    min-width: 120px;
}
