/* Globe Events Page Styles */

* {
    box-sizing: border-box;
}

#app-container {
    display: flex;
    flex-direction: row-reverse;
    /* Sidebar goes to Right, Globe to Left */
    width: 100%;
    height: 100%;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

/* Events Sidebar (now on the right) */
/* Events Sidebar (Light Theme) */
.events-sidebar {
    width: 500px;
    min-width: 500px;
    /* No explicit height — flexbox stretch fills the parent */
    background: #FAF2E8;
    /* Brand Light Beige */
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-right: none;
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.05);
}



.events-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* Scrollbar styling for light theme */
.events-list::-webkit-scrollbar {
    width: 6px;
}

.events-list::-webkit-scrollbar-track {
    background: transparent;
}

.events-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.events-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Coming Soon section header in sidebar */
.events-section-header {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #999;
    padding: 16px 24px 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 8px;
}

/* Coming Soon event card */
.event-card.coming-soon {
    padding: 32px 24px 32px 120px;
}

@media (max-width: 600px) {
    .event-card.coming-soon {
        padding: 32px 16px 32px 88px;
    }
}

.event-card.coming-soon .event-card-date {
    margin-bottom: 12px;
}



/* Coming Soon info card label (plain gray text, no background) */
.info-card-coming-soon-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #999;
    margin: 0 0 6px 0;
}

/* Month label in coming soon info card */
.info-card-month {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #999;
    margin: -2px 0 8px 0;
}




.event-card {
    display: flex;
    /* Row layout */
    gap: 16px;
    padding: 24px;
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.3s ease,
        background 0.2s ease,
        margin 0.3s ease;
    align-items: flex-start;
    margin: 0;
    border-radius: 0;
    position: relative;
}

.event-card:hover {
    transform: scale(1.02);
    box-shadow: inset 4px 0 0 #000, 0 6px 20px rgba(0, 0, 0, 0.15);
    border-top-color: transparent;
    border-radius: 4px;
    margin: 4px 0;
    z-index: 2;
}

.event-card.coming-soon:hover {
    transform: scale(1.02);
    box-shadow: inset 4px 0 0 #000, 0 6px 20px rgba(0, 0, 0, 0.15);
    border-top-color: transparent;
    border-radius: 4px;
    margin: 4px 0;
    z-index: 2;
}

.event-card.coming-soon:last-child {
    border-bottom: none;
}

.event-card.active {
    transform: scale(1.02);
    box-shadow: inset 4px 0 0 #000, 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: transparent;
    margin: 4px 0;
    z-index: 2;
    border-radius: 4px;
}

/* Image styling */
.event-card-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    background: #e0e0e0;
}

.event-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.event-card-content {
    flex: 1;
    min-width: 0;
}

/* Reset margins that Squarespace global styles may inject */
#app-container h4,
#app-container p,
#app-container div {
    margin-top: 0;
}

.event-card-date {
    font-size: 0.95rem;
    font-weight: 400;
    color: #222;
    margin-top: -3px;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.event-card-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #000;
    margin: 0 0 6px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.event-card.past .event-card-title,
.event-card.past .event-card-date,
.event-card.past .event-card-teacher,
.event-card.past .event-card-location {
    color: #343434;
}

.event-card.past .event-card-image img {
    /* Blue duotone: grayscale, then blue tint closer to #2837F5 */
    filter: grayscale(100%) sepia(100%) hue-rotate(190deg) saturate(800%) brightness(0.85);
    background: #2837F5;
}

.event-card-teacher {
    font-size: 0.9rem;
    color: #555;
    margin: 0 0 1.5rem;
}

.event-card-teacher:empty {
    display: none;
}

.event-card-location {
    font-size: 0.8rem;
    color: #777;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.event-card-location::before {
    content: '📍';
    font-size: 0.8rem;
    opacity: 0.6;
}

.event-card-luma-link {
    display: block;
    margin-top: 14px;
    padding: 1.3rem 1.5rem;
    font-size: .9rem;
    color: #fff;
    background: #000;
    text-decoration: none;
    text-align: left;
    border-radius: 999px;
    transition: opacity 0.2s ease, transform 0.15s ease;
    width: fit-content
}

.event-card-luma-link:hover {
    opacity: 0.85;
    transform: scale(1.02);
}

/* Globe Container */
#globe-container {
    position: relative;
    flex: 1;
    /* No explicit height — flexbox stretch fills the parent */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    /* Prevent browser zoom/scroll when interacting with the globe */
}

#globe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Loading state */
#globe-container.loading #globe {
    opacity: 0;
}

#globe-container.loading .loading-smiley {
    display: flex;
}

.loading-smiley {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
}

.loading-smiley .img-smiley {
    width: 80px;
    height: 80px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   Globe Markers - Smooth circular pins
   ============================================================ */

/* ============================================================
   Globe Markers - SVG Pins
   ============================================================ */

/* Marker Layering */
.globe-marker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Anchor point is the bottom tip of the pin */
    transform: translate(-50%, -100%);
    width: 0;
    height: 0;
    overflow: visible;
    z-index: 10;
    transition: z-index 0s linear 0.3s;
}

.globe-marker.selected {
    z-index: 99999 !important;
    transition: z-index 0s;
}

.globe-marker.dimmed {
    z-index: 1;
}

.marker-svg-wrapper {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease, filter 0.3s ease;
    z-index: 10;
}

/* Count badge for cities with multiple events */
.marker-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #fff;
    color: #CC0000;
    border: 1.5px solid #CC0000;
    border-radius: 50%;
    width: 17px;
    height: 17px;
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    font-family: 'Inter', sans-serif;
}

/* Past event badge — gray to match pin */
.globe-marker.past .marker-badge {
    color: #2837F5;
    border-color: #2837F5;
}

.marker-pin {
    width: 100%;
    height: 100%;
    display: block;
    /* Optional: filter inside SVG or here */
}

/* Hover Effect: Scale Up (not on dimmed or currently-selected pins) */
.globe-marker:not(.dimmed):not(.selected):hover .marker-svg-wrapper {
    transform: translateX(-50%) scale(1.2) translateY(-10px);
}

.globe-marker.selected .marker-svg-wrapper {
    transform: translateX(-50%) scale(1.3) translateY(-12px);
    filter: drop-shadow(0 8px 12px rgba(255, 200, 50, 0.5));
}

.globe-marker.dimmed .marker-svg-wrapper {
    opacity: 0.4;
    /* Increased from 0.1 for better visibility */
    transform: translateX(-50%) scale(0.7);
    /* Larger than 0.5 to keep them visible but smaller */
    filter: grayscale(50%) brightness(0.9);
    /* Less aggressive grayscale */
    pointer-events: auto;
    /* Allow clicking dimmed markers to select them */
}

.globe-marker.dimmed .marker-pulse,
.globe-marker.dimmed .marker-shadow {
    opacity: 0;
    visibility: hidden;
    animation: none;
}

/* Past event markers — same size as regular, just grayscale tint */
.globe-marker.past .marker-svg-wrapper {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4)) grayscale(30%);
}

/* Fanned-out individual pins (expanded cluster) — animation plays once on creation only */
.globe-marker.fanned-animate .marker-svg-wrapper {
    animation: fanPinIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* Selected pin in a fanned cluster — animate to the larger selected scale */
.globe-marker.fanned-animate.selected .marker-svg-wrapper {
    animation: fanPinInSelected 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes fanPinIn {
    from {
        transform: translateX(-50%) scale(0);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

@keyframes fanPinInSelected {
    from {
        transform: translateX(-50%) scale(0);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) scale(1.3) translateY(-12px);
        opacity: 1;
    }
}

/* .globe-marker.selected path { } */

/* Ground shadow/pulse */
.marker-shadow {
    position: absolute;
    width: 12px;
    height: 4px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    filter: blur(2px);
    z-index: 1;
}

.marker-pulse {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scale(0.5);
    width: 40px;
    height: 20px;
    /* Flattened oval for 3D ground effect */
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 220, 100, 0.4) 0%, rgba(255, 220, 100, 0) 70%);
    animation: markerPulse 2s ease-out infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes markerPulse {
    0% {
        transform: translateX(-50%) scale(0.5);
        opacity: 0.8;
    }

    100% {
        transform: translateX(-50%) scale(2.5);
        opacity: 0;
    }
}

/* ============================================================
   Info Card - appears directly above the marker
   ============================================================ */

/* ============================================================
   Info Card (Minimal) - Small pointer
   ============================================================ */

/* Target CSS2DRenderer elements directly and via parent wrappers */
.info-card-wrapper {
    z-index: 999999 !important;
    position: relative;
}

div:has(> .info-card-wrapper),
div:has(> .globe-marker.selected) {
    z-index: 999999 !important;
}

div:has(> .globe-marker.dimmed) {
    z-index: 1 !important;
}

div:has(> .globe-marker:not(.selected):not(.dimmed)) {
    z-index: 10 !important;
}

.info-card {
    position: absolute;
    z-index: 99999;
    /* Ensure it is ALWAYS above all markers */
    background: #FAF2E8;
    /* Brand Light Beige */
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 16px 20px;
    /* Increased padding */
    width: max-content;
    max-width: 280px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);

    /* Positioned relative to the anchor point (0,0) of the parent wrapper */
    bottom: 72px;
    /* Reduced to bring it closer to the marker top */
    left: 0;
    transform: translateX(-50%);

    animation: infoCardPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Inter', sans-serif;
    pointer-events: auto;
    /* Essential for interaction */
}

@keyframes infoCardPop {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(15px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* Updated Pointer */
.info-card-pointer {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #FAF2E8;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.info-card-close {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s ease;
}

.info-card-close:hover {
    color: #000;
}

.info-card-content {
    color: #000;
    padding-right: 18px;
    /* Avoid overlap with close btn */
}

.info-card-date {
    font-size: 0.72rem;
    font-weight: 400;
    margin: 0 0 4px 0;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.info-card-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0 0 6px 0;
    color: #000;
    line-height: 1.3;
}

.info-card-location {
    font-size: 0.8rem;
    margin: 0;
    color: #666;
    display: flex;
    align-items: flex-start;
    gap: 4px;
    white-space: normal;
    word-break: break-word;
}

.info-card-teacher {
    font-size: 0.8rem;
    color: #555;
    margin: 0 0 6px 0;
}

.info-card-link {
    display: inline-block;
    background: linear-gradient(135deg, #ffe066, #ffc107);
    color: #1a1a2e;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.info-card-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

/* Tooltip */
.globe-tooltip {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(45, 45, 68, 0.85);
    padding: 10px 20px;
    border-radius: 30px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    display: flex;
    align-items: center;
    white-space: nowrap;
    opacity: 0;
    animation: fadeIn 1s ease-out 1s forwards;
    /* Delay fade in */
}

.tooltip-icon {
    font-size: 1rem;
    margin-right: 6px;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    #app-container {
        flex-direction: column-reverse;
        /* Stack vertically: Globe on top, Events below */
    }

    #globe-container {
        flex: none;
        height: 50vh;
        /* Globe takes top half */
        width: 100%;
    }

    .events-sidebar {
        width: 100%;
        min-width: 0;
        flex: none;
        height: 60vh;
        /* ~2.5 event cards visible so users know it scrolls */
        border-left: none;
        border-top: 2px solid #000;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    }



    .events-list {
        padding: 8px;
    }

    .event-card {
        padding: 16px;
        gap: 12px;
    }

    .event-card-image {
        width: 60px;
        height: 60px;
    }

    /* .event-card-title {
        font-size: 1rem;
    } */

    .info-card {
        min-width: 220px;
        max-width: 280px;
        padding: 12px 14px;
    }

    .info-card-title {
        font-size: 0.95rem;
    }

    .marker-dot {
        width: 14px;
        height: 14px;
    }

    .globe-tooltip {
        bottom: 5px;
        padding: 6px 14px;
        font-size: 0.75rem;
    }

    /* Disable hover transforms on touch devices to prevent tap-triggered jumps */
    .globe-marker:not(.dimmed):not(.selected):hover .marker-svg-wrapper {
        transform: translateX(-50%);
    }
}