.calendar-options-container {
    background-color: #000000;
    padding: 0;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 380px;
    margin: 0;
    position: fixed;
    z-index: 2147483647; /* max z-index — above all story/admin layers */
    display: none;
    max-height: 90dvh;
    overflow: hidden;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Backdrop behind the calendar popup — sized to the iframe via JS */
.popup-backdrop {
    position: fixed;
    z-index: 2147483646; /* one below the popup */
    display: none;
    pointer-events: auto; /* captures clicks to dismiss */
    overflow: hidden;     /* clip canvas to iframe bounds */
    background: rgba(0, 0, 0, 0.45); /* dim the story content behind the popup */
}

/* Canvas fills the backdrop */
.popup-backdrop .popup-bg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Blur effect on popup container — !important overrides the inline background-color */
.calendar-options-container.bg-effect-blur {
    background: rgba(8, 8, 24, 0.82) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Media query for mobile devices */
@media (max-width: 768px) {
    .calendar-options-container {
        width: 92%;
        max-width: calc(100vw - 20px);
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

.close-btn {
    color: #fff;
    position: absolute;
    top: 8px;
    right: 12px;
    left: auto;
    padding: 0;
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
    opacity: 0.7;
}

.close-btn:hover,
.close-btn:focus {
    opacity: 1;
}

.share-header {
    border-bottom: 1px solid white;
    color: white;
	font-family: sans-serif;
	padding-left: 20px;
	padding-bottom: 0px !important;
}

.share-header p {
	margin-top: -20px;
	color: white;
	font-size: 9pt;
}

.share-header div{
    padding-bottom: 0px;
}

.share-header h2{
	color: white;
	font-size: 12pt;
	padding-top: 10px;
}

.share-options-events {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.calendar-btn {
    /* Layout */
    display: flex;
    align-items: center;
    justify-content: center; /* centers the <span> text */
    position: relative;      /* anchor for the absolutely-positioned icon */
    box-sizing: border-box;
    /* Sizing — overridden by container-specific rules */
    width: 100%;
    max-width: 100%;
    margin: 0;
    /* Typography */
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    /* Visual */
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Icon: pinned to the left, vertically centred — text centres independently */
.calendar-btn img {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    margin: 0;
    flex-shrink: 0;
    pointer-events: none;
}

.calendar-btn:hover,
.calendar-btn:focus {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    animation: none;
}

/* Per-calendar colour (inline buttonColor from JS overrides these) */
.calendar-btn.apple   { background: white; color: #000; }
.calendar-btn.google  { background: white; color: #000; }
.calendar-btn.outlook { background: white; color: #000; }
.calendar-btn.office  { background: white; color: #000; }
.calendar-btn.yahoo   { background: white; color: #000; }

.row {

    justify-content: center;
    width: 80%; /* Ensuring full width */
}

.full-width {
    width: 80%; /* Adjusting to full width */
    max-width: 80%; /* Restricting to 80% of the viewport width */
}

/* ── Popup entrance keyframes ── */
@keyframes popupFlipIn {
    from { transform: translate(-50%,-50%) rotateY(-90deg) scale(0.8); opacity: 0; }
    to   { transform: translate(-50%,-50%) rotateY(0)      scale(1);   opacity: 1; }
}
@keyframes popupTaDa {
    0%   { transform: translate(-50%,-50%) scale(0)    rotate(-5deg); opacity: 0; }
    60%  { transform: translate(-50%,-50%) scale(1.15) rotate(3deg); }
    80%  { transform: translate(-50%,-50%) scale(0.95) rotate(-1deg); }
    100% { transform: translate(-50%,-50%) scale(1)    rotate(0);    opacity: 1; }
}
@keyframes popupBounceIn {
    0%   { transform: translate(-50%,-150%) scale(0.8); opacity: 0; }
    60%  { transform: translate(-50%,-45%)  scale(1.05); opacity: 1; }
    80%  { transform: translate(-50%,-52%)  scale(0.97); }
    100% { transform: translate(-50%,-50%)  scale(1); }
}
@keyframes popupGlowIn {
    from { transform: translate(-50%,-50%) scale(0.5); opacity: 0; filter: brightness(4); }
    to   { transform: translate(-50%,-50%) scale(1);   opacity: 1; filter: brightness(1); }
}
@keyframes popupSlideUp {
    from { transform: translate(-50%,-30%); opacity: 0; }
    to   { transform: translate(-50%,-50%); opacity: 1; }
}
@keyframes popupSpinZoom {
    from { transform: translate(-50%,-50%) scale(0.2) rotate(-180deg); opacity: 0; }
    to   { transform: translate(-50%,-50%) scale(1)   rotate(0);       opacity: 1; }
}

/* Theme classes no longer control animation — use anim-X classes instead */

/* ── Independent animation classes (override theme-based animation) ── */
.calendar-options-container.popup-animate.anim-flip   { animation: popupFlipIn   0.6s cubic-bezier(.25,.46,.45,.94) forwards; perspective: 800px; }
.calendar-options-container.popup-animate.anim-tada   { animation: popupTaDa     0.7s cubic-bezier(.36,.07,.19,.97) forwards; }
.calendar-options-container.popup-animate.anim-bounce { animation: popupBounceIn 0.6s cubic-bezier(.28,.84,.42,1)   forwards; }
.calendar-options-container.popup-animate.anim-glow   { animation: popupGlowIn   0.5s ease-out                      forwards; }
.calendar-options-container.popup-animate.anim-slide  { animation: popupSlideUp  0.4s ease-out                      forwards; }
.calendar-options-container.popup-animate.anim-spin   { animation: popupSpinZoom 0.6s cubic-bezier(.17,.67,.83,.67) forwards; }

/* ── Theme border / decoration styles ── */
.calendar-options-container.theme-newspaper { font-family: Georgia, serif; border: 3px double #7b4a1e; }
.calendar-options-container.theme-party     { border: 2px solid #ff1de8; box-shadow: 0 0 20px #ff1de8, 0 0 40px #aa00ff; }
.calendar-options-container.theme-sports    { border-top: 4px solid #00b3ff; }
.calendar-options-container.theme-concert   { border: 1px solid #9b30ff; box-shadow: 0 0 25px #9b30ff; }
.calendar-options-container.theme-corporate { border-radius: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.calendar-options-container.theme-festival  { border: 3px solid #ffd700; border-radius: 16px; }

/* ==========================================================================
   Event info card
   ========================================================================== */
.popup-event-card {
    padding: 36px 16px 12px;   /* top: 36px to clear close button */
    border-bottom: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 0;
}

.popup-urgency-badge {
    display: inline-block;
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.popup-event-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 4px 0 4px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.01em;
}

/* In date/countdown modes the title renders as a div, not h2 — keep same visual style */
.popup-event-title:not(h2) {
    font-size: 16px;
    font-weight: 700;
    margin: 6px 0 2px;
}

.popup-event-description {
    font-size: 12px;
    color: rgba(255,255,255,0.72);
    margin-top: 5px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popup-event-countdown {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.popup-event-countdown.countdown-hms {
    font-family: 'SF Mono', ui-monospace, 'Courier New', monospace;
    letter-spacing: 0.06em;
    font-size: 26px;
}

.popup-event-datetime,
.popup-event-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #fff;
    opacity: 0.82;
    margin-top: 5px;
    line-height: 1.4;
}

.popup-event-datetime svg,
.popup-event-location svg {
    flex-shrink: 0;
    opacity: 0.75;
}

/* ==========================================================================
   Calendar prompt (replaces old share-header)
   ========================================================================== */
.popup-calendar-prompt {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.5);
    margin: 0;
    padding: 10px 16px 6px;
}

/* ==========================================================================
   Primary calendar button
   ========================================================================== */
.popup-primary-cal {
    width: 100%;
    padding: 6px 16px 4px;
    box-sizing: border-box;
    position: relative;
}

.popup-primary-cal .calendar-btn {
    /* padding: vertical | right-balance | vertical | icon-area(16+20+8) */
    padding: 13px 44px;
}


/* ==========================================================================
   Secondary calendar buttons (single column, stacked)
   ========================================================================== */
.calendar-secondary-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 16px 14px;
    box-sizing: border-box;
    width: 100%; /* must be explicit — parent uses align-items:center */
}

.calendar-secondary-grid .calendar-btn {
    padding: 13px 44px; /* matches primary — same symmetric padding around centered text */
}

/* ==========================================================================
   Confirmation / success state
   ========================================================================== */
@keyframes successFadeIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

.popup-success-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px 28px;
    text-align: center;
    animation: successFadeIn 0.35s cubic-bezier(.25,.46,.45,.94) forwards;
}

.popup--confirmed .share-options-events,
.popup--confirmed .popup-calendar-prompt {
    display: none;
}

.popup--confirmed .popup-success-state {
    display: flex;
}

.popup-success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2ed573;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    box-shadow: 0 0 0 6px rgba(46,213,115,0.18);
}

.popup-success-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
}

.popup-success-body {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    margin: 0;
}

/* ==========================================================================
   Light theme overrides (newspaper, corporate)
   ========================================================================== */
.calendar-options-container.theme-newspaper .popup-event-card,
.calendar-options-container.theme-corporate .popup-event-card {
    border-bottom-color: rgba(0,0,0,0.12);
}


.calendar-options-container.theme-newspaper .popup-event-title,
.calendar-options-container.theme-corporate .popup-event-title,
.calendar-options-container.theme-newspaper .popup-event-countdown,
.calendar-options-container.theme-corporate .popup-event-countdown {
    color: #111;
}

.calendar-options-container.theme-newspaper .popup-event-description,
.calendar-options-container.theme-corporate .popup-event-description {
    color: rgba(0,0,0,0.60);
}

.calendar-options-container.theme-newspaper .popup-event-datetime,
.calendar-options-container.theme-newspaper .popup-event-location,
.calendar-options-container.theme-corporate .popup-event-datetime,
.calendar-options-container.theme-corporate .popup-event-location {
    color: #333;
}

.calendar-options-container.theme-newspaper .popup-urgency-badge,
.calendar-options-container.theme-corporate .popup-urgency-badge {
    background: rgba(0,0,0,0.10);
    color: #333;
}

.calendar-options-container.theme-newspaper .popup-calendar-prompt,
.calendar-options-container.theme-corporate .popup-calendar-prompt {
    color: rgba(0,0,0,0.45);
}

.calendar-options-container.theme-newspaper .popup-success-title,
.calendar-options-container.theme-corporate .popup-success-title {
    color: #111;
}

.calendar-options-container.theme-newspaper .popup-success-body,
.calendar-options-container.theme-corporate .popup-success-body {
    color: rgba(0,0,0,0.55);
}

/* ==========================================================================
   Focus rings (accessibility)
   ========================================================================== */
.calendar-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.close-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
    border-radius: 2px;
}

/* ==========================================================================
   Party confetti canvas — sits inside the popup, layered behind content
   ========================================================================== */
.calendar-options-container .popup-party-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border-radius: 10px;
    z-index: 0;
}

/* ==========================================================================
   Chat Box theme — iMessage-style light UI
   ========================================================================== */
.calendar-options-container.theme-chatbox {
    background: #F2F2F7 !important;
    border-radius: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
    box-shadow: 0 6px 24px rgba(0,0,0,0.14), 0 1px 4px rgba(0,0,0,0.08);
}

/* Message bubble — received-message style with left ghost tail */
.calendar-options-container.theme-chatbox .popup-event-card {
    background: #FFFFFF;
    border-radius: 4px 18px 18px 18px;
    margin: 28px 12px 0 18px; /* top 28px: 18px for "Event" label + 10px buffer above close btn */
    padding: 12px 14px 12px 14px;
    border-bottom: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: relative;
}

/* Ghost tail — left-pointing triangle attached to the bubble */
.calendar-options-container.theme-chatbox .popup-event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 0px solid transparent;
    border-right: 9px solid #FFFFFF;
    border-bottom: 9px solid transparent;
}

/* "Event" sender label above the card */
.calendar-options-container.theme-chatbox .popup-event-card::after {
    content: 'Event';
    display: block;
    position: absolute;
    top: -18px;
    left: 0;
    font-size: 10px;
    font-weight: 600;
    color: #007AFF;
    letter-spacing: 0.04em;
}

/* Text colours — dark on white bubble */
.calendar-options-container.theme-chatbox .popup-event-title {
    color: #1C1C1E;
    font-size: 16px;
    font-weight: 700;
}

.calendar-options-container.theme-chatbox .popup-event-description {
    color: rgba(28,28,30,0.65);
}

.calendar-options-container.theme-chatbox .popup-event-countdown {
    color: #1C1C1E;
}

.calendar-options-container.theme-chatbox .popup-event-datetime,
.calendar-options-container.theme-chatbox .popup-event-location {
    color: #3C3C43;
    opacity: 1;
}

.calendar-options-container.theme-chatbox .popup-urgency-badge {
    background: #007AFF;
    color: #FFFFFF;
}

/* Calendar prompt — styled as a chat section divider */
.calendar-options-container.theme-chatbox .popup-calendar-prompt {
    color: #8E8E93;
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    text-align: center;
    padding: 12px 16px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.calendar-options-container.theme-chatbox .popup-calendar-prompt::before,
.calendar-options-container.theme-chatbox .popup-calendar-prompt::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #D1D1D6;
}

/* Primary button — solid blue "sent message" style */
.calendar-options-container.theme-chatbox .popup-primary-cal {
    padding: 4px 12px 4px;
}

.calendar-options-container.theme-chatbox .popup-primary-cal .calendar-btn {
    border-radius: 14px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: none;
}

/* Secondary buttons — white bordered quick-reply chips */
.calendar-options-container.theme-chatbox .calendar-secondary-grid {
    gap: 6px;
    padding: 4px 12px 14px;
}

/* Chatbox secondary buttons: same appearance as primary — colour comes from JS buttonColor */
.calendar-options-container.theme-chatbox .calendar-secondary-grid .calendar-btn {
    border: none;
}

/* Close button — grey on light background */
.calendar-options-container.theme-chatbox .close-btn {
    color: #8E8E93;
}

/* Success state text colours */
.calendar-options-container.theme-chatbox .popup-success-title {
    color: #1C1C1E;
}

.calendar-options-container.theme-chatbox .popup-success-body {
    color: #8E8E93;
}

/* === Icon shrink-to-corner state ========================================= */
.event-icon-in-corner {
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    opacity: 0.9;
    z-index: 10001;
}

.event-icon-in-corner:hover {
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

/* === Slide-expand calendar pill button =================================== */
.cal-expand-btn {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    width: 44px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    z-index: 10001;
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 8px;
    box-sizing: border-box;
}

.cal-expand-btn.expanded {
    width: 152px;
    border-radius: 22px;
}

.cal-expand-btn img {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    object-fit: contain;
}

.cal-expand-label {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.25s ease 0.35s;
}

.cal-expand-btn.expanded .cal-expand-label {
    opacity: 1;
}

.cal-expand-btn:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    transform: scale(1.05);
}

/* === Fullscreen tap-through overlay (opt-in per event) =================== */
.event-fullscreen-hit {
    position: absolute;
    background: transparent;
    cursor: pointer;
    z-index: 10000;
}

/* ── Custom icon-size input ──────────────────────────────────── */
.event-circle-col-custom {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.event-circle-custom-input {
    width: 56px;
    padding: 4px 6px;
    font-size: 12px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.24);
    border-radius: 4px;
    background: #fff;
    color: #000;
}
.event-circle-custom-label {
    font-size: 11px;
    opacity: 0.7;
}

/* ── Calendar label admin controls ───────────────────────────── */
#event-metabox-container .event-cal-label-input {
    box-sizing: border-box;
    width: 100%;
    height: 56px;
    padding: 0 16px;
    font-size: 1rem;
    font-family: var(--event-font);
    border: 1px solid rgba(0, 0, 0, 0.38);
    border-radius: 4px;
    background: #fff;
    color: #000;
}
#event-metabox-container .event-cal-label-input:focus {
    outline: none;
    border: 2px solid #000;
}

/* ── Calendar Label Case radio row ───────────────────────────── */
#event-metabox-container .event-cal-case-radios {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}
#event-metabox-container .event-cal-case-radio-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-family: var(--event-font);
    cursor: pointer;
}
