@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary-color: #0048fe;
  --secondary-color: #394867;
  --accent-color: #ff0000;
  --dark-color: #1B1B1B;
  --light-color: #fe0505;
  --glass-color: rgba(250, 248, 248, 0.05);
  --glass-border: 1px solid rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  --glass-blur: blur(12px);
  --transition-speed: 0.25s;
  --font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background: linear-gradient(135deg, var(--dark-color) 0%, #222831 100%);
  color: var(--light-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Screen reader only */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  border: 0 !important;
}

.header {
  padding: 20px;
  background: rgba(25, 25, 35, 0.85);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  user-select: none;
}

.logo i {
  font-size: 28px;
  color: var(--accent-color);
}

.logo h1 {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.search-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.search-icon,
.clear-search {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.7);
  z-index: 2;
  pointer-events: none;
}

.clear-search {
  right: 15px;
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-speed);
}

#search-input {
  width: 100%;
  padding: 12px 45px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 16px;
  outline-offset: 2px;
  outline-color: var(--accent-color);
  transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#search-input:focus {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 8px var(--accent-color);
}

#search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.main-container {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  height: calc(100vh - 110px); /* Adjusted for header/footer */
  min-height: 400px;
  position: relative;
}

.map-and-buttons {
  display: flex;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  gap: 15px;
  padding: 15px 20px;
  box-sizing: border-box;
}

.buttons-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--glass-color);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: 12px;
  width: 140px;
  max-height: 100%;
  overflow-y: auto;
  box-shadow: var(--glass-shadow);
  user-select: none;
}

.location-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: var(--glass-border);
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed);
  user-select: none;
}

.location-button i {
  font-size: 16px;
  color: var(--accent-color);
  flex-shrink: 0;
}

.location-button:hover,
.location-button:focus-visible {
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  box-shadow: 0 0 8px var(--accent-color);
}

.location-button.active,
.location-button[aria-pressed="true"] {
  background: var(--accent-color);
  color: #000;
  font-weight: 600;
  cursor: default;
  box-shadow: 0 0 12px var(--accent-color);
}

.map-container {
  flex: 1;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  background: #111;
}

#map {
  width: 100%;
  height: 100%;
  outline: none;
}

.location-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 500px;
  padding: 25px;
  background: var(--glass-color);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--glass-shadow);
  display: none;
  z-index: 1000;
  overflow-y: auto;
  max-height: 70vh;
  animation: fadeIn var(--transition-speed) ease-out;
  outline-offset: 2px;
  outline-color: var(--accent-color);
}

.location-info[aria-hidden="false"] {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -55%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.location-info h2,
.location-info h3 {
  font-size: 20px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-color);
  user-select: none;
}

.location-info ul {
  list-style: none;
  padding-left: 0;
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 15px;
}

.location-line {
  padding: 10px;
  margin: 6px 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-speed);
  user-select: none;
}

.location-line:hover,
.location-line:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(6px);
  outline: none;
  box-shadow: 0 0 5px var(--accent-color);
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  transition: transform var(--transition-speed);
  user-select: none;
}

.close-btn:hover,
.close-btn:focus-visible {
  transform: rotate(90deg);
  color: var(--accent-color);
  outline: none;
  box-shadow: 0 0 8px var(--accent-color);
}

/* Intro overlay styles */
#intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--dark-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 9999;
  animation: introFadeOut 1s ease forwards;
  animation-delay: 4s;
  animation-fill-mode: forwards;
}

.logo-blur-container {
  color: var(--accent-color);
  text-align: center;
  filter: blur(15px);
  animation: blurInOut 4s ease forwards;
  user-select: none;
}

.logo-blur-container .logo-icon {
  font-size: 80px;
}

.logo-blur-container h1 {
  font-size: 32px;
  font-weight: 700;
  margin-top: 12px;
}

/* Intro overlay animations */
@keyframes blurInOut {
  0% {
    filter: blur(15px);
    opacity: 0;
    transform: scale(0.8);
  }
  50% {
    filter: blur(0);
    opacity: 1;
    transform: scale(1);
  }
  100% {
    filter: blur(15px);
    opacity: 0;
    transform: scale(1.2);
  }
}

@keyframes introFadeOut {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .map-and-buttons {
    flex-direction: column;
  }
  .buttons-container {
    flex-direction: row;
    width: 100%;
    overflow-x: auto;
    max-height: 60px;
    padding: 10px;
    border-radius: 12px;
  }
  .location-button {
    flex: 0 0 auto;
  }
}

@media (max-width: 600px) {
  .logo h1 {
    font-size: 20px;
  }
  .location-button {
    font-size: 13px;
    padding: 8px 10px;
  }
  .main-container {
    height: calc(100vh - 90px);
  }
  .location-info {
    width: 95%;
    max-width: none;
    max-height: 60vh;
  }
}

footer.copyright {
  text-align: center;
  padding: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  user-select: none;
  background: rgba(25, 25, 35, 0.8);
  backdrop-filter: var(--glass-blur);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--glass-shadow);
  flex-shrink: 0;
}
