/* Modal Custom Lgndrygroup – inspired premium design, fully responsive */

/* Design tokens (overridable via inline --smp-* from plugin) */
.sidebar-modal-overlay {
    --smp-glow: rgba(37, 99, 235, 0.2);
    --smp-text: #0f172a;
    --smp-muted: #64748b;
}

/* Overlay – soft blur backdrop for depth (inset fallback for older Safari) */
.sidebar-modal-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    z-index: 100000;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    box-sizing: border-box;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-modal-overlay[hidden] {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.sidebar-modal-overlay.is-visible {
    visibility: visible;
    opacity: 1;
}

.sidebar-modal-backdrop {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    background: rgba(0, 0, 0, var(--smp-overlay-opacity, 0.55));
    cursor: pointer;
}

@supports (backdrop-filter: blur(8px)) {
    .sidebar-modal-backdrop {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

/* Wrap – scrollable, generous max-width */
.sidebar-modal-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 1.5rem);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 576px) {
    .sidebar-modal-overlay {
        padding: 1.25rem;
    }

    .sidebar-modal-wrap {
        max-width: 540px;
        max-height: calc(100vh - 2.5rem);
    }
}

/* Card – premium feel and accent (-webkit- for Safari) */
.sidebar-modal-box {
    /* background: rgba(256,256,256,.7); */
    background: #13134b !important;
    box-shadow:
        0 32px 64px -12px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    -webkit-animation: sidebar-modal-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: sidebar-modal-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    -webkit-transform: scale(0.9);
    transform: scale(0.9);
}

/* Subtle accent line at top using primary color */
/* .sidebar-modal-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--smp-primary, #2563eb), var(--smp-button-bg, #2563eb));
    z-index: 1;
} */

@-webkit-keyframes sidebar-modal-in {
    from {
        opacity: 0;
        -webkit-transform: scale(0.94) translateY(16px);
        transform: scale(0.94) translateY(16px);
    }
    to {
        opacity: 1;
        -webkit-transform: scale(1) translateY(0);
        transform: scale(1) translateY(0);
    }
}

@keyframes sidebar-modal-in {
    from {
        opacity: 0;
        -webkit-transform: scale(0.94) translateY(16px);
        transform: scale(0.94) translateY(16px);
    }
    to {
        opacity: 1;
        -webkit-transform: scale(1) translateY(0);
        transform: scale(1) translateY(0);
    }
}

/* Header – compact badge + floating close */
.sidebar-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1rem 0.75rem;
    position: relative;
}

@media (min-width: 576px) {
    .sidebar-modal-header {
        padding: 1rem 1.25rem 0.875rem;
    }
}

/* Title as small event-style badge */
.sidebar-modal-title {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    /* color: var(--smp-primary, #d91f6a); */
    line-height: 1.3;
    padding: 0.35rem 0.75rem;
    /* background: rgba(37, 99, 235, 0.08); */
    /* border-radius: 999px; */
    display: inline-block;
    letter-spacing: 1px;
    font-size: 1.2em;
    color: #fff !important;
    text-transform: capitalize;
}

@media (max-width: 575.98px) {
    .sidebar-modal-title {
        font-size: 1.2em;
        letter-spacing: 1px;
    }
}

.sidebar-modal-title::before,
.sidebar-modal-title::after {
    display: none;
}

/* Close – minimal circle, doesn’t compete with content */
.sidebar-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.06);
    color: var(--smp-muted);
    font-size: 3rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    padding-bottom: 2px;
}

@media (max-width: 575.98px) {
    .sidebar-modal-close {
        min-width: 40px;
        min-height: 40px;
        width: 40px;
        height: 40px;
        font-size: 3em;
        padding-bottom: 2px !important;
    }
}

.sidebar-modal-close:hover,
.sidebar-modal-close:focus {
    background: rgba(15, 23, 42, 0.1);
    color: var(--smp-text);
    outline: none;
}

.sidebar-modal-close:active {
    transform: scale(0.94);
}

.sidebar-modal-close:focus-visible {
    outline: 2px solid var(--smp-primary, #2563eb);
    outline-offset: 2px;
}

/* Featured image – lazy load + skeleton */
.sidebar-modal-featured {
    width: 100%;
    line-height: 0;
    box-sizing: border-box;
    padding: 0 20px;
}


.sidebar-modal-featured-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.06);
    min-height: 500px;
}

@media (max-width: 575.98px) {
    .sidebar-modal-featured {
        padding: 0;
    }

    .sidebar-modal-featured-wrap {
        min-height: 300px;
    }
}



/* Skeleton placeholder */
.sidebar-modal-featured-skeleton {
    position: absolute;
    inset: 0;
    min-height: 200px;
    background: linear-gradient(
        105deg,
        rgba(15, 23, 42, 0.06) 0%,
        rgba(15, 23, 42, 0.06) 40%,
        rgba(15, 23, 42, 0.12) 50%,
        rgba(15, 23, 42, 0.06) 60%,
        rgba(15, 23, 42, 0.06) 100%
    );
    background-size: 200% 100%;
    animation: sidebar-modal-skeleton-shimmer 1.2s ease-in-out infinite;
}

.sidebar-modal-featured-loaded .sidebar-modal-featured-skeleton {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

@keyframes sidebar-modal-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Image link – full area clickable */
.sidebar-modal-featured-link {
    display: block;
    width: 100%;
    line-height: 0;
    text-decoration: none;
    color: inherit;
}

.sidebar-modal-featured-link:focus {
    outline: none;
}

.sidebar-modal-featured-link:focus-visible .sidebar-modal-featured-img {
    outline: 2px solid var(--smp-primary, #2563eb);
    outline-offset: 2px;
}

.sidebar-modal-featured-img {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: top;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.sidebar-modal-featured-loaded .sidebar-modal-featured-img {
    opacity: 1;
}

/* When no image, keep actions spaced from header */
.sidebar-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem 1.25rem 1.75rem;
}

@media (min-width: 576px) {
    .sidebar-modal-actions {
        padding: 1.5rem 1.5rem 2rem;
        gap: 0.875rem;
    }
}

@media (max-width: 575.98px) {
    .sidebar-modal-actions {
        padding: 1.35rem 1rem 1.5rem;
    }
}

/* Primary CTA – solid, prominent */
.sidebar-modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-sizing: border-box;

    border-radius: 0;
    font-size: 1.2em !important;
    padding: 0;
    background: #D71362;
    color: #fff !important;
}

a.sidebar-modal-btn.sidebar-modal-btn-tickets {
    background: #B803BC !important;
}


@media (max-width: 575.98px) {
    .sidebar-modal-btn {
        font-size: 1.5em !important;
    }
}


.sidebar-modal-btn:hover {
    opacity: .7;
}

@media (min-width: 576px) {
    .sidebar-modal-btn {
        min-height: 52px;
        font-size: 1rem;
    }
}



.sidebar-modal-btn:active {
    transform: scale(0.98);
}

.sidebar-modal-btn:focus-visible {
    outline: 2px solid var(--smp-primary, #2563eb);
    outline-offset: 2px;
}

/* Single button: keep solid style */
.sidebar-modal-actions:has(.sidebar-modal-btn:only-child) .sidebar-modal-btn {
    background: var(--smp-button-bg, #2563eb);
    border: none;
}

/* Safe area */
@supports (padding: max(0px)) {
    .sidebar-modal-overlay {
        padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .sidebar-modal-overlay,
    .sidebar-modal-close,
    .sidebar-modal-btn {
        transition: none;
    }
    .sidebar-modal-box {
        -webkit-animation: none;
        animation: none;
    }
    .sidebar-modal-close:active,
    .sidebar-modal-btn:active {
        transform: none;
    }
    .sidebar-modal-featured-skeleton {
        animation: none;
        background: rgba(15, 23, 42, 0.08);
    }
}
