/* =========================================
   WRAPPER & SYSTEM STYLES (Gold Standard)
   ========================================= */
.ioa-world-congress-v2 {
    position: relative;
    width: 100%;
}

.ioa-world-congress-v2 *,
.ioa-world-congress-v2 *::before,
.ioa-world-congress-v2 *::after {
    box-sizing: border-box;
}

/* =========================================
   TELEPORT SLOTS (Gold Standard Feature)
   ========================================= */
.ioa-teleport-slot {
    min-height: 0;
    transition: all 0.3s ease;
    margin-bottom: 0;
    width: 100%;
}

.ioa-teleport-slot.has-content {
    margin-bottom: 2rem;
    animation: ioa-fade-in 0.5s ease;
}

/* Editor Visuals - Visible only in Elementor Editor (.is-editor-mode added via PHP) */
.is-editor-mode .ioa-teleport-slot {
    min-height: 40px;
    border: 1px dashed rgba(16, 185, 129, 0.3); /* Using Emerald Green for distinction */
    background: rgba(16, 185, 129, 0.05);
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.is-editor-mode .ioa-teleport-slot::before {
    content: attr(data-label);
    font-size: 11px;
    color: #059669;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

@keyframes ioa-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   PPT VIEWER STYLES (IFRAME)
   ========================================= */
.ioa-ppt-container {
    width: 100%;
    margin-bottom: 2rem;
    position: relative;
    background: #f8fafc;
    border-radius: var(--radius-xl, 1rem);
    border: 1px solid var(--color-border, #e2e8f0);
    overflow: hidden;
    /* Height is set via inline style from widget settings */
}

.ioa-ppt-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.ioa-ppt-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #ef4444;
    text-align: center;
    padding: 2rem;
}

/* =========================================
   ORIGINAL STYLES (Preserved & Scoped)
   ========================================= */

.ioa-congress-sidebar-v3 {
    --color-primary: #1e3a8a;
    --color-primary-dark: #1e40af;
    --color-primary-light: rgba(30, 58, 138, 0.08);
    --color-ea3g-blue: #0284c7;
    --color-accent: #10b981;
    --color-surface: #ffffff;
    --color-background: #f8fafc;
    --color-border: #e2e8f0;
    --color-text-primary: #0f172a;
    --color-text-secondary: #475569;
    --color-date-blue: #1e40af;
    --color-location-tag: #0ea5e9;
    --color-loading: #64748b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 2.5rem;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 1rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-secondary);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.ioa-congress-sidebar-v3 *,
.ioa-congress-sidebar-v3 *::before,
.ioa-congress-sidebar-v3 *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.ioa-congress-sidebar-v3 .ioa-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-xl);
}

.ioa-congress-sidebar-v3 .ioa-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.ioa-congress-sidebar-v3 .ioa-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(28px, 4vw, 34px);
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-text-primary);
    margin-bottom: var(--space-lg);
    position: relative;
    padding-bottom: 10px;
}

.ioa-congress-sidebar-v3 .ioa-header h1::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-ea3g-blue));
    border-radius: 2px;
}

.ioa-congress-sidebar-v3 .ioa-header .ioa-subtitle {
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
    opacity: 0.9;
}

.ioa-congress-sidebar-v3 .ioa-loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    z-index: 10;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.ioa-congress-sidebar-v3 .ioa-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.ioa-congress-sidebar-v3 .ioa-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ioa-congress-sidebar-v3 .ioa-map-layout {
    display: flex;
    gap: var(--space-lg);
    height: 800px;
    max-height: 85vh;
    position: relative;
}

.ioa-congress-sidebar-v3 .ioa-sidebar {
    flex: 0 0 380px;
    background-color: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.ioa-congress-sidebar-v3 .ioa-sidebar-header {
    padding: var(--space-md) var(--space-lg);
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--color-surface) 0%, #f1f5f9 100%);
}

.ioa-congress-sidebar-v3 .ioa-sidebar-list {
    list-style: none;
    padding: var(--space-sm);
    margin: 0;
    overflow-y: auto;
    flex-grow: 1;
    scroll-behavior: smooth;
}

.ioa-congress-sidebar-v3 .ioa-sidebar-list::-webkit-scrollbar { width: 6px; }
.ioa-congress-sidebar-v3 .ioa-sidebar-list::-webkit-scrollbar-track { background: var(--color-background); border-radius: 10px; }
.ioa-congress-sidebar-v3 .ioa-sidebar-list::-webkit-scrollbar-thumb { background-color: var(--color-border); border-radius: 10px; transition: var(--transition-fast); }
.ioa-congress-sidebar-v3 .ioa-sidebar-list::-webkit-scrollbar-thumb:hover { background-color: var(--color-text-secondary); }

.ioa-congress-sidebar-v3 .ioa-location-tab {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border-left: 4px solid transparent;
    margin-bottom: var(--space-sm);
    position: relative;
    outline: none;
}

.ioa-congress-sidebar-v3 .ioa-location-tab:hover {
    background-color: var(--color-primary-light);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.ioa-congress-sidebar-v3 .ioa-location-tab:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.ioa-congress-sidebar-v3 .ioa-location-tab.active {
    background-color: var(--color-primary-light);
    border-left-color: var(--color-primary);
    transform: translateX(4px);
}

.ioa-congress-sidebar-v3 .ioa-location-tab-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: var(--color-text-primary);
    line-height: 1.4;
    margin-bottom: 4px;
}

.ioa-congress-sidebar-v3 .ioa-location-tab-date {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-date-blue);
}

.ioa-congress-sidebar-v3 .ioa-map-main-content {
    flex: 1 1 auto;
    position: relative;
    min-width: 0;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.ioa-congress-sidebar-v3 .ioa-mapbox-map {
    width: 100%;
    height: 100%;
    box-shadow: var(--shadow-xl);
}

.mapboxgl-canvas { cursor: grab !important; }
.mapboxgl-canvas:active { cursor: grabbing !important; }
.mapboxgl-marker { cursor: pointer; }

.ioa-congress-sidebar-v3 .ioa-map-marker {
    width: 36px;
    height: 36px;
    transform: translate(-50%, -100%);
    outline: none;
}

.ioa-congress-sidebar-v3 .ioa-map-marker:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 4px; border-radius: 50%; }
.ioa-congress-sidebar-v3 .ioa-map-marker svg { overflow: visible; transition: var(--transition-fast); filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.ioa-congress-sidebar-v3 .marker-default-state { opacity: 1; transform-origin: center; transition: var(--transition-fast); transform: scale(0.6); }
.ioa-congress-sidebar-v3 .default-circle { fill: var(--color-primary); filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3)); }
.ioa-congress-sidebar-v3 .default-text { font-size: 12px; font-family: 'Poppins', sans-serif; font-weight: 600; fill: white; }
.ioa-congress-sidebar-v3 .marker-hover-state { opacity: 0; transform: scale(0.6); transform-origin: bottom center; transition: var(--transition-fast); }
.ioa-congress-sidebar-v3 .hover-pin { fill: var(--color-ea3g-blue); filter: drop-shadow(0 4px 5px rgba(0,0,0,0.3)); }
.ioa-congress-sidebar-v3 .hover-text { font-size: 11px; font-family: 'Poppins', sans-serif; font-weight: 600; fill: white; }
.ioa-congress-sidebar-v3 .ioa-map-marker:hover .marker-default-state,
.ioa-congress-sidebar-v3 .ioa-map-marker.active .marker-default-state { opacity: 0; transform: scale(0); }
.ioa-congress-sidebar-v3 .ioa-map-marker:hover .marker-hover-state,
.ioa-congress-sidebar-v3 .ioa-map-marker.active .marker-hover-state { opacity: 1; transform: scale(1); }

/* --- MODAL FIX (Un-Scoped for Body Append) --- */
.ioa-modal-overlay {
    --color-primary: #1e3a8a;
    --color-primary-dark: #1e40af;
    --color-primary-light: rgba(30, 58, 138, 0.08);
    --color-ea3g-blue: #0284c7;
    --color-accent: #10b981;
    --color-surface: #ffffff;
    --color-background: #f8fafc;
    --color-border: #e2e8f0;
    --color-text-primary: #0f172a;
    --color-text-secondary: #475569;
    --color-date-blue: #1e40af;
    --color-location-tag: #0ea5e9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-md: 8px;
    --radius-xl: 1rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
    padding: var(--space-lg);
}

.ioa-modal-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

.ioa-modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    outline: none;
    display: flex;
    flex-direction: column;
}

.ioa-modal-overlay.active .ioa-modal-content { transform: scale(1); }

.ioa-modal-close {
    position: absolute;
    top: 12px; right: 12px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--color-border);
    color: var(--color-text-secondary);
    border: none; cursor: pointer;
    font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    transition: var(--transition);
    z-index: 10;
    outline: none;
}

.ioa-modal-close:hover { background: #d1d5db; transform: rotate(90deg); }
.ioa-modal-close:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.ioa-modal-image-wrapper {
    display: none;
    flex-shrink: 0;
}

.ioa-modal-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    background-color: var(--color-background);
}

.ioa-modal-text {
    padding: var(--space-xl);
    overflow: hidden;
}
.ioa-modal-title { font-family: 'Poppins', sans-serif; font-size: 22px; color: var(--color-text-primary); margin-bottom: var(--space-sm); line-height: 1.3; }

.ioa-modal-location {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--color-location-tag);
    color: white; font-size: 12px; font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-sm);
}

.location-icon { width: 12px; height: 12px; fill: currentColor; }
.ioa-modal-date { display: flex; align-items: center; gap: 8px; color: var(--color-accent); font-size: 14px; font-weight: 500; margin-bottom: var(--space-lg); }
.date-icon { width: 16px; height: 16px; fill: currentColor; }
.ioa-modal-description { font-size: 15px; margin-bottom: var(--space-xl); line-height: 1.6; }
.ioa-modal-links { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: var(--space-lg); }
.ioa-modal-link-item { display: inline-flex; align-items: center; gap: 8px; color: var(--color-primary); text-decoration: none; font-size: 13px; font-weight: 500; padding: 10px 16px; border: 1px solid var(--color-primary-light); border-radius: var(--radius-md); transition: var(--transition); background: #f8fafc; outline: none; }
.ioa-modal-link-item:hover { background: var(--color-primary); color: white; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.ioa-modal-link-item:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.link-icon { width: 14px; height: 14px; fill: currentColor; }
.ioa-modal-contact { background: #f8fafc; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px; font-size: 13px; color: var(--color-text-secondary); line-height: 1.5; margin-top: var(--space-lg); }
.ioa-modal-contact a { color: var(--color-primary); text-decoration: none; font-weight: 500; transition: var(--transition-fast); }
.ioa-modal-contact a:hover { text-decoration: underline; }

@media (max-width: 992px) {
    .ioa-congress-sidebar-v3 .ioa-map-layout { flex-direction: column; height: auto; max-height: none; }
    .ioa-congress-sidebar-v3 .ioa-sidebar { flex: 0 0 auto; height: 300px; }
    .ioa-congress-sidebar-v3 .ioa-map-main-content { height: 500px; }
}

@media (max-width: 768px) {
    .ioa-congress-sidebar-v3 .ioa-header h1 { font-size: 28px; }
    .ioa-congress-sidebar-v3 .ioa-container { padding: var(--space-lg) var(--space-md); }
    .ioa-modal-content { margin-top: 0; margin-bottom: var(--space-md); max-width: calc(100% - 2rem); }
    .ioa-modal-links { flex-direction: column; }
    .ioa-modal-link-item { justify-content: center; }
}

@media (max-width: 480px) {
    .ioa-congress-sidebar-v3 .ioa-sidebar { height: 250px; }
    .ioa-congress-sidebar-v3 .ioa-map-main-content { height: 400px; }
}

@media (prefers-reduced-motion: reduce) {
    .ioa-congress-sidebar-v3 * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}