#wmWidget #mapWrap{width:100%;background:#f9eadf;border-radius:16px}
#wmWidget #mapWrap svg{width:100%;height:auto;display:block;background:#f9eadf;border-radius:16px;box-shadow:0 6px 24px rgba(0,0,0,.08)}

/* Prevent site/global heading styles from leaking into the widget */
#wmWidget h4{background:transparent !important}

/* Scope all map path styles to this widget to avoid collisions with any existing `.country` class in the host site */
#wmWidget .country{fill:#d9dde3;stroke:#fff;stroke-width:.5;transition:filter 150ms ease, fill 150ms ease}
#wmWidget .country.usa{fill:#000}
#wmWidget .country.highlight{fill:#dc3545;cursor:pointer}
#wmWidget .country.highlight:hover{filter:brightness(.96) drop-shadow(0 0 10px rgba(220,53,69,.35))}

/* Fallback: if JS class toggling is prevented, still show orange on hover */
#wmWidget .country:hover{fill:var(--bs-orange, var(--bs-warning, #fd7e14)) !important}

/* Use Bootstrap 5 CSS variables; fall back to warning; final fallback to Bootstrap Orange (#fd7e14). */
#wmWidget .country.hover-orange{fill:var(--bs-orange, var(--bs-warning, #fd7e14)) !important}
#wmWidget .country.selected-orange{fill:var(--bs-orange, var(--bs-warning, #fd7e14)) !important}
#wmWidget .country.btn-focus{fill:var(--bs-orange, var(--bs-warning, #fd7e14)) !important;filter:none;stroke-width:1.2}

@keyframes vz-border-blink{
  0%{stroke-opacity:1;stroke-width:4;stroke-dashoffset:0;filter:drop-shadow(0 0 10px var(--bs-orange, var(--bs-warning, #fd7e14)))}
  50%{stroke-opacity:.15;stroke-width:1.2;stroke-dashoffset:-24;filter:none}
  100%{stroke-opacity:1;stroke-width:4;stroke-dashoffset:-48;filter:drop-shadow(0 0 10px var(--bs-orange, var(--bs-warning, #fd7e14)))}
}
#wmWidget svg .country.venezuela{
  fill:var(--bs-orange, var(--bs-warning, #fd7e14)) !important;
  stroke:var(--bs-orange, var(--bs-warning, #fd7e14)) !important;
  stroke-linejoin:round;
  stroke-linecap:round;
  stroke-dasharray:10 6;
  animation:vz-border-blink .7s linear infinite !important;
}
body.zooming #wmWidget .country.venezuela,
body.modal-open #wmWidget .country.venezuela{
  animation-duration:3.2s;
}

#wmWidget #countryButtons{width:100%}

/* Always keep spacing between country buttons (desktop only; mobile uses slider gaps) */
#wmWidget #countryButtons:not(.cb-slider){gap:.5rem !important}

/* Fallback for live sites not using Bootstrap 5 gap utilities */
#wmWidget .gap-2{gap:.5rem !important}
@supports not (gap: 1rem){
  #wmWidget .gap-2 > *{margin:0 0 .5rem 0; margin-inline-start:.5rem}
}

/* Desktop/tablet: let buttons size to their text (no overlap) */
@media (min-width: 577px){
  #wmWidget #countryButtons{
    display:flex !important; /* keep flex-wrap behavior */
    flex-wrap:wrap;
    align-items:stretch;
  }
  #wmWidget #countryButtons > .btn{
    width:auto;
    flex:0 0 auto;
    white-space:nowrap;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
  }
}

/* Country button nav (Prev/Next) */
#wmWidget .cb-nav{width:100%}
#wmWidget .cb-nav-btn{display:none !important}

/* Avoid conflict with Bootstrap's `.tooltip` class */
.wm-tooltip{
  position:fixed;pointer-events:none;
  background:rgba(0,0,0,.85);color:#fff;
  padding:7px 10px;border-radius:10px;font-size:13px;
  transform:translate(12px,12px);
  opacity:0;transition:opacity 120ms ease;
  z-index:9999;max-width:min(340px, calc(100vw - 24px));
}

#countryModal .modal-content{direction:rtl;text-align:right}
#countryModal .modal-body, #countryModal .modal-title{unicode-bidi:plaintext}

/* Auto-play controls */
#wmWidget #autoPlayControls{
  position:absolute;
  top:65px;
  left:20px;
  z-index:101;
  display:flex;
  gap:8px;
}
#wmWidget #autoPlayToggle,
#wmWidget #fullscreenToggle,
#wmWidget #zoomInBtn,
#wmWidget #zoomOutBtn{
  width:48px;
  height:48px;
  border-radius:50%;
  background:#209ec9;
  border:none;
  color:#fff;
  font-size:20px;
  cursor:pointer;
  box-shadow:0 2px 8px rgba(0,0,0,0.2);
  transition:background 0.2s ease;
  display:flex;
  align-items:center;
  justify-content:center;
}
#wmWidget #autoPlayToggle:hover,
#wmWidget #fullscreenToggle:hover,
#wmWidget #zoomInBtn:hover,
#wmWidget #zoomOutBtn:hover{
  background:#1a7ea0;
}

/* Auto-play country info overlay */
#wmWidget #countryInfoOverlay{
  position:absolute;
  top:65px;
  right:20px;
  background:#209ec9;
  color:#fff;
  padding:16px 24px;
  border-radius:12px;
  text-align:right;
  direction:rtl;
  opacity:0;
  pointer-events:none;
  transition:opacity 0.5s ease;
  z-index:100;
  max-width:350px;
  box-shadow:0 4px 12px rgba(0,0,0,0.3);
}
#wmWidget #countryInfoOverlay.show{
  opacity:1;
  pointer-events:auto;
}
#wmWidget #countryInfoOverlay h3{
  margin:0 0 8px 0;
  font-size:1.4rem;
  font-weight:bold;
}
#wmWidget #countryInfoOverlay p{
  margin:0 0 6px 0;
  font-size:1rem;
}
#wmWidget #countryInfoOverlay p:last-child{
  margin-bottom:0;
}
#wmWidget #countryInfoOverlay .read-more-btn{
  display:none;
  margin-top:12px;
  padding:8px 16px;
  background:#fff;
  color:#209ec9;
  border:none;
  border-radius:6px;
  font-size:0.95rem;
  font-weight:600;
  cursor:pointer;
  transition:background 0.2s ease;
  width:100%;
  pointer-events:auto;
}
#wmWidget #countryInfoOverlay .read-more-btn:hover{
  background:#f0f0f0;
}
#wmWidget #countryInfoOverlay .read-more-btn.show{
  display:block;
}

/* Progress bar for country dwell time */
#wmWidget .country-progress-bar{
  position:absolute;
  bottom:0;
  left:0;
  right:0;
  height:4px;
  background:rgba(255,255,255,0.2);
  border-radius:0 0 12px 12px;
  overflow:hidden;
}
#wmWidget .country-progress-bar-fill{
  height:100%;
  background:#fd7e14;
  width:0%;
  transition:width 100ms linear;
}

/* Highlight active country in animation */
#wmWidget .country.active-animation{
  fill:#209ec9 !important;
  stroke:#fff;
  stroke-width:0.5;
}

/* Fullscreen mode styles */
#mapWrap:fullscreen,
#mapWrap:-webkit-full-screen,
#mapWrap:-moz-full-screen,
#mapWrap:-ms-fullscreen {
  background: #f9eadf;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mapWrap:fullscreen #countryInfoOverlay,
#mapWrap:-webkit-full-screen #countryInfoOverlay,
#mapWrap:-moz-full-screen #countryInfoOverlay,
#mapWrap:-ms-fullscreen #countryInfoOverlay {
  position: fixed !important;
  top: 90px !important;
  right: 20px !important;
  opacity: 1;
  z-index: 10000;
}

#mapWrap:fullscreen #countryInfoOverlay.show,
#mapWrap:-webkit-full-screen #countryInfoOverlay.show,
#mapWrap:-moz-full-screen #countryInfoOverlay.show,
#mapWrap:-ms-fullscreen #countryInfoOverlay.show {
  opacity: 1;
  pointer-events: auto;
}

#mapWrap:fullscreen #autoPlayControls,
#mapWrap:-webkit-full-screen #autoPlayControls,
#mapWrap:-moz-full-screen #autoPlayControls,
#mapWrap:-ms-fullscreen #autoPlayControls {
  position: fixed !important;
  top: 20px !important;
  left: 20px !important;
  z-index: 10000;
}

/* Remove horizontal padding from card-body */
#wmWidget .card-body {
  padding: 0 !important;

}

@media (max-width: 576px){
  #wmWidget .cb-nav{
    display:grid;
    grid-template-columns:36px 1fr 36px;
    gap:8px;
    align-items:stretch;
  }
  #wmWidget .cb-nav-btn{
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
    padding:0;
    background:#1f9ec9 !important;
    color:#fff !important;
    border-color:#1f9ec9 !important;
  }

  /* Mobile: make the country buttons a swipeable slider.
     Each slide contains 1 button. */
  #wmWidget #countryButtons.cb-slider{
    display:grid !important;
    grid-auto-flow:column;
    /* show part of the next slide for a "gradual" feel */
    grid-auto-columns:calc(100% - 84px);
    gap:12px;

    overflow-x:auto;
    overflow-y:hidden;
    scroll-snap-type:x mandatory;
    scroll-padding:12px;
    -webkit-overflow-scrolling:touch;
    touch-action:pan-x;

    padding:4px 2px 8px;
  }
  #wmWidget #countryButtons.cb-slider::-webkit-scrollbar{display:none}
  #wmWidget #countryButtons.cb-slider{scrollbar-width:none}

  #wmWidget #countryButtons.cb-slider .cb-slide{
    scroll-snap-align:start;
    display:flex;
    flex-direction:row;
    gap:10px;
    min-width:0;
  }
  #wmWidget #countryButtons.cb-slider .cb-slide .btn{
    width:100%;
    white-space:nowrap;
    padding:.35rem .6rem;
  }
}

/* Mobile responsive styles for map */
@media (max-width: 768px) {
  #wmWidget #mapContainer {
    display: flex;
    flex-direction: column;
  }

  #wmWidget #northSouthIcons {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 0px;
    background: #fff;
    border-bottom: 2px solid #ddd;
    z-index: 10;
    order: 1;
    flex-shrink: 0;
  }

  #wmWidget #northSouthIcons .ns-item {
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
  }

  #wmWidget #northSouthIcons .ns-item span {
    font-size: 11px !important;
  }

  #wmWidget #autoPlayControls {
    position: relative;
    top: auto;
    left: auto;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: #faebd7;
    border-bottom: 1px solid #eee;
    z-index: 10;
    order: 2;
    flex-shrink: 0;
  }

  #wmWidget #autoPlayControls button {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  #wmWidget #mapWrap {
    position: relative;
    order: 3;
    flex-shrink: 0;
  }

  #wmWidget #mapWrap svg {
    width: 100%;
    height: auto;
    border-radius: 0;
  }

  #wmWidget #countryInfoOverlay {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 20px;
    background: #1f9ec9 !important;
    color: #fff !important;
    border-top: 3px solid #fff;
    border-radius: 0 !important;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
    order: 4;
    min-height: 120px;
    overflow-y: auto;
    flex-shrink: 0;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  #wmWidget #countryInfoOverlay h3,
  #wmWidget #countryInfoName {
    font-size: 20px !important;
    color: #fff !important;
  }

  #wmWidget #countryInfoOverlay p,
  #wmWidget #countryInfoDate,
  #wmWidget #countryInfoEvent {
    font-size: 14px !important;
    color: #fff !important;
  }

  #wmWidget #countryInfoOverlay .read-more-btn {
    background: #fff !important;
    color: #1f9ec9 !important;
  }
}

#shareModal .form-control{min-width:min(520px, 100%)}
#shareModal #embedCode{
  font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}