* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: linear-gradient(to bottom, #f8fafc, #eef2f5);
}

.main-content {
  display: flex;
  flex: 1; 
  overflow: hidden;
}


.topbar {
  position: static; 
  transform: none;
  left: auto;
  
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 5%;
  background: white;
  width: 100%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
}

.brand h1 {
  font-size: 1.8rem; 
  color: #243642;
}

.brand p {
  font-size: 1.02rem;
  color: #5f6f78;
}

.controls {
  display: flex;
  gap: 10px;
}

.topbar input,
.topbar select {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.visited-count {
  background: #e6f4ea;
  color: #166534;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
}

#map {
  width: 100%;
  max-width: 1000px;
  height: 620px;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
  overflow: hidden;
  background: #02324d;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: none;
  z-index: 900;
}

#countryPanel {
  position: fixed;
  left: 50%;
  bottom: -260px;
  transform: translateX(-50%);
  width: min(500px, 80vw);
  min-height: 180px;
  max-height: 260px;
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.98);
  color: #243642;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.12);
  z-index: 1001;
  transition: bottom 0.3s ease;
  border: 1px solid #e3e8ec;
  overflow-y: auto;
}

#countryPanel.active {
  bottom: 0;
}

.terminal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  color: #60717c;
  font-size: 1.4rem;
  cursor: pointer;
}

#countryDetails {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-right: 30px;
}


#countryDetails h2 {
  font-size: 2rem;
  margin-bottom: 8px;
  color: #243642;
}

#countryDetails p {
  margin-bottom: 6px;
  font-size: 1rem;
  color: #3f525e;
}

#countryDetails img {
  width: 150px;
  height: auto;
  border-radius: 8px;
  border: 1px solid #d9e1e6;
}

#countryDetails button {
  margin-top: 10px;
  padding: 6px 10px;

  background: transparent;
  border: 1px solid #551A8B;
  color: #551A8B;
  cursor: pointer;
}

body.panel-open .leaflet-tooltip {
  display: none;
}

.leaflet-interactive:focus {
  outline: none;
}

.legend {
  background: white;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  line-height: 1.4;
}

.legend div {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.legend span {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 3px;
}