/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Rubik', sans-serif;
  font-size: 18px;
  line-height: 1.5;
  color: hsl(0, 0%, 17%);
  background-color: #f5f5f5;
  min-height: 100vh;
}

/* Header Section */
.header {
  background-image: url('./images/pattern-bg-mobile.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  padding-bottom: 120px;
}

.header-content {
  text-align: center;
  padding: 26px 24px 32px;
}

.header-title {
  color: white;
  font-size: 26px;
  font-weight: 500;
  margin-bottom: 29px;
  line-height: 1.2;
}

/* Search Form */
.search-form {
  margin-bottom: 24px;
}

.search-container {
  display: flex;
  max-width: 555px;
  margin: 0 auto;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 50px 50px -25px rgba(0, 0, 0, 0.1);
}

.search-input {
  flex: 1;
  padding: 18px 24px;
  border: none;
  font-size: 18px;
  font-family: inherit;
  outline: none;
  color: hsl(0, 0%, 17%);
  cursor: pointer;
}

.search-input::placeholder {
  color: hsl(0, 0%, 58%);
}

.search-input:focus {
  outline: none;
}

.search-btn {
  background-color: hsl(0, 0%, 17%);
  border: none;
  padding: 18px 24px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  background-color: hsl(0, 0%, 35%);
}

.search-btn:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

.search-icon {
  width: 11px;
  height: 14px;
}

/* Info Panel */
.info-panel {
  position: absolute;
  bottom: -90px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 1110px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 50px 50px -25px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 26px 24px 24px;
}

.info-item {
  text-align: center;
}

.info-label {
  font-size: 10px;
  font-weight: 700;
  color: hsl(0, 0%, 58%);
  text-transform: uppercase;
  letter-spacing: 1.45px;
  margin-bottom: 7px;
}

.info-value {
  font-size: 20px;
  font-weight: 500;
  color: hsl(0, 0%, 17%);
  line-height: 1.2;
  word-break: break-all;
}

/* Map Section */
.map-section {
  height: calc(100vh - 280px);
  min-height: 500px;
  position: relative;
  z-index: 1;
}

.map-container {
  width: 100%;
  height: 100%;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid hsl(0, 0%, 17%);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Error Message */
.error-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ff4444;
  color: white;
  padding: 16px 24px;
  border-radius: 8px;
  display: none;
  z-index: 2001;
  font-size: 14px;
  text-align: center;
  max-width: 90%;
}

/* Attribution */
.attribution {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 16px;
  border-radius: 20px;
  z-index: 1002;
}

.attribution a {
  color: hsl(228, 45%, 44%);
  text-decoration: none;
}

.attribution a:hover {
  text-decoration: underline;
}

/* Custom Leaflet Marker */
.custom-marker {
  background-image: url('./images/icon-location.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 46px;
  height: 56px;
  border: none;
  border-radius: 0;
}

/* Tablet Styles */
@media (min-width: 768px) {
  .header-content {
    padding: 33px 40px 48px;
  }

  .header-title {
    font-size: 32px;
    margin-bottom: 31px;
  }

  .info-panel {
    bottom: -75px;
    width: calc(100% - 80px);
  }

  .info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    padding: 37px 32px 37px;
  }

  .info-item {
    text-align: left;
  }

  .info-label {
    font-size: 11px;
    margin-bottom: 13px;
  }

  .info-value {
    font-size: 26px;
  }

  .map-section {
    height: calc(100vh - 300px);
  }
}

/* Desktop Styles */
@media (min-width: 1024px) {
  .header {
    background-image: url('./images/pattern-bg-desktop.png');
    padding-bottom: 100px;
  }

  .header-content {
    padding: 37px 40px 48px;
  }

  .header-title {
    margin-bottom: 37px;
  }

  .info-panel {
    bottom: -90px;
  }

  .info-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 37px 32px 37px;
  }

  .info-item {
    padding-right: 32px;
    position: relative;
  }

  .info-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 75px;
    background: hsl(0, 0%, 85%);
  }

  .info-label {
    font-size: 12px;
    margin-bottom: 13px;
  }

  .info-value {
    font-size: 26px;
  }

  .map-section {
    height: calc(100vh - 280px);
  }
}

/* Large Desktop */
@media (min-width: 1440px) {
  .map-section {
    height: calc(100vh - 300px);
  }
}