/* ==========================================================================
   CreateIt Cookie Consent — Frontend Styles
   Author: Digibold SIA | Licensed for bluemarine.lv only
   ========================================================================== */

/* --------------------------------------------------------------------------
   Custom Properties
   -------------------------------------------------------------------------- */
#bmcc {
    --bmcc-navy:        #030C54;
    --bmcc-navy-light:  #0d1e7a;
    --bmcc-white:       #ffffff;
    --bmcc-offwhite:    #f7f6f1;
    --bmcc-border:      rgba(3, 12, 84, 0.10);
    --bmcc-text:        #030C54;
    --bmcc-muted:       #6b7280;
    --bmcc-periwinkle:  #C9D3F0;
    --bmcc-success:     #059669;
    --bmcc-radius:      0px;
    --bmcc-radius-lg:   0px;
    --bmcc-shadow:
        0 0 0 1px rgba(3, 12, 84, 0.07),
        0 8px 24px rgba(3, 12, 84, 0.08),
        0 32px 80px rgba(3, 12, 84, 0.14);
    --bmcc-transition:  0.4s ease-in-out;
    --bmcc-w:           460px;
    --bmcc-font-head:   ABCProphet, 'Helvetica Neue', Arial, sans-serif;
    --bmcc-font-serif:  'Portrait Web', Georgia, 'Times New Roman', serif;
    --bmcc-font-body:   basis-grotesque-regular-pro, 'Helvetica Neue', Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   Entrance animation — content staggers in after card slides up
   -------------------------------------------------------------------------- */
@keyframes bmcc-fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bmcc--visible .bmcc__brand {
    animation: bmcc-fade-up 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.10s both;
}
.bmcc--visible .bmcc__desc {
    animation: bmcc-fade-up 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.19s both;
}
.bmcc--visible .bmcc__privacy-link {
    animation: bmcc-fade-up 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.24s both;
}
.bmcc--visible .bmcc__actions {
    animation: bmcc-fade-up 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.29s both;
}

/* --------------------------------------------------------------------------
   Base wrapper — hidden by default
   -------------------------------------------------------------------------- */
#bmcc {
    position: fixed;
    z-index: 99990;
    width: var(--bmcc-w);
    max-width: calc(100vw - 32px);
    font-family: var(--bmcc-font-body);
    font-size: 14px;
    line-height: 1.55;
    color: var(--bmcc-text);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity  0.55s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Position variants */
#bmcc.bmcc--bottom-left {
    bottom: 32px;
    left: 32px;
    transform: translateY(28px);
}
#bmcc.bmcc--bottom-right {
    bottom: 32px;
    right: 32px;
    transform: translateY(28px);
}
#bmcc.bmcc--bottom-center {
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(28px);
}

/* Visible state */
#bmcc.bmcc--visible {
    opacity: 1;
    pointer-events: auto;
}
#bmcc.bmcc--bottom-left.bmcc--visible,
#bmcc.bmcc--bottom-right.bmcc--visible {
    transform: translateY(0);
}
#bmcc.bmcc--bottom-center.bmcc--visible {
    transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */
.bmcc__inner {
    background: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
            backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(3, 12, 84, 0.13);
    border-radius: var(--bmcc-radius-lg);
    box-shadow:
        0 0 0 1px rgba(3, 12, 84, 0.07),
        0 8px 24px rgba(3, 12, 84, 0.10),
        0 32px 80px rgba(3, 12, 84, 0.18);
    overflow: hidden;
}

@supports not (backdrop-filter: blur(1px)) {
    .bmcc__inner {
        background: rgba(255, 255, 255, 0.97);
    }
}

/* Periwinkle accent line at top */
.bmcc__inner::before {
    content: '';
    display: block;
    height: 2px;
    background: var(--bmcc-periwinkle);
}

/* --------------------------------------------------------------------------
   Compact Banner
   -------------------------------------------------------------------------- */
.bmcc__banner {
    padding: 26px 28px 24px;
}

.bmcc__brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.bmcc__icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--bmcc-border);
    border-radius: 0;
    color: var(--bmcc-navy);
}

.bmcc__title {
    font-family: var(--bmcc-font-serif);
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--bmcc-navy);
    margin: 0;
    line-height: 1.2;
}

.bmcc__desc {
    margin: 0 0 20px;
    font-size: 12.5px;
    color: var(--bmcc-muted);
    line-height: 1.65;
}

.bmcc__privacy-link {
    display: inline-block;
    color: var(--bmcc-navy);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-transform: uppercase;
    margin-top: 6px;
    opacity: 0.55;
    transition: opacity var(--bmcc-transition);
}
.bmcc__privacy-link:hover { opacity: 1; }

/* --------------------------------------------------------------------------
   [ccc_settings_link] shortcode / data-ccc-open trigger
   -------------------------------------------------------------------------- */
.bmcc-settings-link {
    color: inherit;
    font-size: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: currentColor;
    transition: opacity var(--bmcc-transition);
    cursor: pointer;
}

.bmcc-settings-link:hover,
.bmcc-settings-link:focus-visible {
    opacity: 1;
    outline-offset: 2px;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Action Buttons
   -------------------------------------------------------------------------- */
.bmcc__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 18px;
}

.bmcc__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    font-family: var(--bmcc-font-head);
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    border-radius: var(--bmcc-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition:
        background-color var(--bmcc-transition),
        color var(--bmcc-transition),
        border-color var(--bmcc-transition),
        opacity var(--bmcc-transition);
    white-space: nowrap;
    line-height: 1;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.bmcc__btn--primary {
    background: var(--bmcc-navy);
    color: var(--bmcc-white);
    border-color: var(--bmcc-navy);
}
/* Shimmer sweep on hover — luxury feel */
.bmcc__btn--primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 20%,
        rgba(255, 255, 255, 0.09) 50%,
        transparent 80%
    );
    transform: translateX(-110%);
    transition: transform 0.65s ease;
}
.bmcc__btn--primary:hover::after {
    transform: translateX(110%);
}
.bmcc__btn--primary:hover {
    background: var(--bmcc-navy-light);
    border-color: var(--bmcc-navy-light);
}

.bmcc__btn--outline {
    background: transparent;
    color: var(--bmcc-navy);
    border-color: rgba(3, 12, 84, 0.35);
}
.bmcc__btn--outline:hover {
    background: var(--bmcc-navy);
    color: var(--bmcc-white);
    border-color: var(--bmcc-navy);
}

.bmcc__btn--ghost {
    background: transparent;
    color: var(--bmcc-muted);
    border-color: transparent;
    padding-left: 0;
    padding-right: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(107, 114, 128, 0.35);
    font-size: 10px;
}
.bmcc__btn--ghost:hover {
    color: var(--bmcc-navy);
    text-decoration-color: var(--bmcc-navy);
}

/* Customize always first / leftmost */
.bmcc__actions .bmcc__btn--ghost {
    margin-right: auto;
}

/* Settings button expand/collapse chevron */
.bmcc__settings-chevron {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    vertical-align: middle;
    transition: transform 0.25s ease;
    transform: rotate(0deg);
}
.bmcc--settings .bmcc__settings-chevron {
    transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   Settings Panel
   -------------------------------------------------------------------------- */
.bmcc__panel {
    border-top: 1px solid var(--bmcc-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

#bmcc.bmcc--settings .bmcc__panel {
    max-height: 800px;
    overflow-y: auto;
}

.bmcc__panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px 16px;
    border-bottom: 1px solid var(--bmcc-border);
    position: sticky;
    top: 0;
    background: var(--bmcc-white);
    z-index: 2;
}

.bmcc__panel-title {
    font-family: var(--bmcc-font-head);
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--bmcc-muted);
    margin: 0;
}

.bmcc__panel-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: var(--bmcc-muted);
    cursor: pointer;
    border-radius: 0;
    transition: border-color var(--bmcc-transition), color var(--bmcc-transition);
    flex-shrink: 0;
}
.bmcc__panel-close:hover {
    border-color: var(--bmcc-border);
    color: var(--bmcc-navy);
}

/* --------------------------------------------------------------------------
   Cookie Categories
   -------------------------------------------------------------------------- */
.bmcc__categories {
    padding: 4px 0;
}

.bmcc__cat {
    border-bottom: 1px solid var(--bmcc-border);
    position: relative;
}
.bmcc__cat:last-child { border-bottom: none; }

/* Periwinkle left accent line on hover/open */
.bmcc__cat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--bmcc-periwinkle);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.bmcc__cat:hover::before,
.bmcc__cat--open::before {
    transform: scaleY(1);
}

.bmcc__cat-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 28px;
    transition: background-color 0.25s ease;
}
.bmcc__cat-row:hover { background: rgba(247, 246, 241, 0.7); }

.bmcc__cat-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.bmcc__cat-expand {
    flex-shrink: 0;
    margin-top: 2px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    color: var(--bmcc-muted);
    transition: transform 0.25s ease, color 0.25s ease;
}
.bmcc__cat-expand svg {
    display: block;
}
.bmcc__cat--open .bmcc__cat-expand {
    transform: rotate(90deg);
    color: var(--bmcc-navy);
}

.bmcc__cat-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.bmcc__cat-name {
    font-family: var(--bmcc-font-head);
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bmcc-navy);
    display: block;
}

.bmcc__cat-desc {
    font-size: 11.5px;
    color: var(--bmcc-muted);
    line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Toggle Switch
   -------------------------------------------------------------------------- */
.bmcc__toggle {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    margin-top: 3px;
}

.bmcc__toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.bmcc__toggle-track {
    position: relative;
    display: block;
    width: 44px;
    height: 24px;
    background: rgba(3, 12, 84, 0.12);
    border-radius: 12px;
    transition: background-color 0.35s ease;
    flex-shrink: 0;
}

.bmcc__toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--bmcc-white);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Navy when active */
.bmcc__toggle-input:checked + .bmcc__toggle-track {
    background: var(--bmcc-navy);
}
.bmcc__toggle-input:checked + .bmcc__toggle-track .bmcc__toggle-thumb {
    transform: translateX(20px);
}
.bmcc__toggle-input:focus-visible + .bmcc__toggle-track {
    outline: 2px solid var(--bmcc-navy);
    outline-offset: 2px;
}

.bmcc__toggle--locked {
    cursor: not-allowed;
}
.bmcc__toggle--locked .bmcc__toggle-track {
    background: var(--bmcc-navy);
    opacity: 0.4;
}
.bmcc__toggle--locked .bmcc__toggle-thumb {
    transform: translateX(20px);
}

.bmcc__toggle-label {
    font-size: 9px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--bmcc-muted);
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Expandable Cookie Table
   -------------------------------------------------------------------------- */
.bmcc__cat-cookies {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bmcc__cat--open .bmcc__cat-cookies {
    max-height: 600px;
}

.bmcc__cookies-table-wrap {
    padding: 0 28px 16px;
    overflow-x: auto;
}

.bmcc__cookies-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 11px;
    color: var(--bmcc-text);
}

/* Fixed column widths: Name 28% | Provider 20% | Duration 16% | Purpose fills rest */
.bmcc__cookies-table th:nth-child(1),
.bmcc__cookies-table td:nth-child(1) { width: 28%; }
.bmcc__cookies-table th:nth-child(2),
.bmcc__cookies-table td:nth-child(2) { width: 20%; }
.bmcc__cookies-table th:nth-child(3),
.bmcc__cookies-table td:nth-child(3) { width: 16%; }

.bmcc__cookies-table thead tr {
    border-bottom: 1px solid var(--bmcc-border);
}

.bmcc__cookies-table th {
    font-family: var(--bmcc-font-head);
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bmcc-muted);
    padding: 6px 8px 6px 0;
    text-align: left;
    white-space: nowrap;
}

.bmcc__cookies-table td {
    padding: 8px 8px 8px 0;
    vertical-align: top;
    border-bottom: 1px solid rgba(3, 12, 84, 0.05);
    line-height: 1.45;
    color: var(--bmcc-muted);
}

.bmcc__cookies-table tbody tr:last-child td {
    border-bottom: none;
}

.bmcc__cookies-table tbody tr:nth-child(even) td {
    background: rgba(247, 246, 241, 0.5);
}

/* Cookie name column — monospace, wraps on long hashes */
.bmcc__cookies-table td:first-child {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 10px;
    color: var(--bmcc-navy);
    word-break: break-all;
    overflow-wrap: break-word;
}

.bmcc__cookies-table td.bmcc-col-duration {
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Panel Actions
   -------------------------------------------------------------------------- */
.bmcc__panel-actions {
    display: flex;
    gap: 8px;
    padding: 16px 28px 20px;
    background: var(--bmcc-offwhite);
    border-top: 1px solid var(--bmcc-border);
    position: sticky;
    bottom: 0;
}

.bmcc__panel-actions .bmcc__btn--ghost {
    padding-left: 0;
    padding-right: 8px;
    margin-right: auto;
}

.bmcc__panel-actions .bmcc__btn--primary {
    flex: 1;
}

/* --------------------------------------------------------------------------
   Position variants (mobile always bottom-full-width)
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
    #bmcc,
    #bmcc.bmcc--bottom-left,
    #bmcc.bmcc--bottom-right,
    #bmcc.bmcc--bottom-center {
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        transform: translateY(28px);
    }

    #bmcc.bmcc--visible,
    #bmcc.bmcc--bottom-left.bmcc--visible,
    #bmcc.bmcc--bottom-right.bmcc--visible,
    #bmcc.bmcc--bottom-center.bmcc--visible {
        transform: translateY(0);
    }

    .bmcc__inner {
        border-radius: 8px 8px 0 0;
    }

    /* No entrance stagger on mobile — faster UX */
    .bmcc--visible .bmcc__brand,
    .bmcc--visible .bmcc__desc,
    .bmcc--visible .bmcc__privacy-link,
    .bmcc--visible .bmcc__actions {
        animation-delay: 0s;
    }

    .bmcc__banner {
        padding: 20px 20px 18px;
    }

    .bmcc__panel-header,
    .bmcc__cat-row {
        padding-left: 20px;
        padding-right: 20px;
    }

    .bmcc__cookies-table-wrap {
        padding-left: 20px;
        padding-right: 20px;
    }

    .bmcc__panel-actions {
        padding-left: 20px;
        padding-right: 20px;
        flex-wrap: wrap;
    }

    .bmcc__panel-actions .bmcc__btn--primary {
        flex: 1 0 100%;
    }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    #bmcc,
    .bmcc__panel,
    .bmcc__cat-cookies,
    .bmcc__toggle-track,
    .bmcc__toggle-thumb,
    .bmcc__btn,
    .bmcc__btn::after,
    .bmcc__cat-expand,
    .bmcc__cat::before,
    .bmcc--visible .bmcc__brand,
    .bmcc--visible .bmcc__desc,
    .bmcc--visible .bmcc__privacy-link,
    .bmcc--visible .bmcc__actions {
        transition: none !important;
        animation: none !important;
    }
}
