/* Clean Custom Location Modal Styles */

:root {
  --gold: #d4af37;
  --gold-bright: #f5d976;
  --gold-dim: #b89530;
  --dark: #0a0a0a;
  --card: #1a1a1a;
}

/* Modal Container */
.custom-location-overlay * {
  font-family: 'Josefin_Medium', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
}

/* Overlay */
.custom-location-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
}

.custom-location-overlay.show {
  opacity: 1;
}

/* Modal */
.custom-location-modal {
  background: var(--card);
  border: 2px solid var(--gold);
  border-radius: 16px;
  width: 95%;
  max-width: 900px;
  max-height: 95vh;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.3);
  transform: scale(0.95);
  transition: transform 0.3s;
}

.custom-location-overlay.show .custom-location-modal {
  transform: scale(1);
}

/* Close Button */
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--gold);
  font-size: 32px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(212, 175, 55, 0.1);
  transform: rotate(90deg);
}

/* Header */
.modal-header {
  text-align: center;
  padding: 40px 24px 24px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.header-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold-bright));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
  position: relative;
}

.header-icon .material-icons {
  font-size: 48px;
  color: var(--dark);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  line-height: 1;
}

.modal-header h2 {
  color: var(--gold);
  font-size: 28px;
  margin: 0 0 8px;
  font-family: 'Josefin_Bold', sans-serif;
  font-weight: 700;
}

.modal-header p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  margin: 0;
  font-family: 'Josefin_Light', sans-serif;
}

/* Body */
.modal-body {
  padding: 24px;
  max-height: calc(90vh - 220px);
  overflow-y: auto;
}

/* Current Location Button */
.btn-current-location {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: var(--dark);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

.btn-current-location:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(212, 175, 55, 0.5);
}

.btn-current-location:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Divider */
.divider {
  margin: 24px 0;
  text-align: center;
  position: relative;
}

.divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(212, 175, 55, 0.2);
}

.divider span {
  position: relative;
  background: var(--card);
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  text-transform: uppercase;
}

/* Coordinates Grid */
.coords-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.coords-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-size: 14px;
  margin-bottom: 8px;
  font-weight: 500;
}

.coords-grid label .material-icons {
  font-size: 18px;
}

.coords-grid input {
  width: 100%;
  padding: 12px;
  background: rgba(212, 175, 55, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  color: white;
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
}

.coords-grid input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.coords-grid input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

/* Wave Loader - Liquid Fill Animation */
.search-bar-loader {
  margin: 24px 0;
  width: 100%;
}

.search-bar-inner {
  position: relative;
  height: 70px;
  background: linear-gradient(
    180deg,
    rgba(10, 18, 30, 0.95) 0%,
    rgba(18, 32, 50, 0.98) 50%,
    rgba(10, 18, 30, 0.95) 100%
  );
  border-radius: 50px;
  border: 2px solid rgba(110, 160, 220, 0.4);
  overflow: hidden;
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.7),
    0 0 22px rgba(110, 160, 220, 0.35);
}

.wave-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Group that contains the waves – we animate horizontal motion on the paths,
   not the group itself (group only used for clip + possible future tweaks). */
.wave-group {
  transform: translateY(0%);
}

/* Base styling for water */
.wave {
  fill: rgba(110, 170, 235, 0.45);
}

/* Back wave: softer, slower, deeper color */
.wave-back {
  fill: rgba(90, 150, 215, 0.38);
  animation: waveScrollBack 7s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* Front wave: brighter, slightly faster */
.wave-front {
  fill: rgba(135, 190, 245, 0.52);
  animation: waveScrollFront 5s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

/* Horizontal scrolling for waves – the paths are wider than the bar,
   so translating X gives an endless, looping motion */
@keyframes waveScrollBack {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-25%);
  }
}

@keyframes waveScrollFront {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-35%);
  }
}

/* Label on top of the liquid */
.search-bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: rgba(210, 235, 255, 0.96);
  font-size: 16px;
  font-weight: 700;
  font-family: 'Josefin_Bold', sans-serif;
  letter-spacing: 1px;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.9),
    0 0 12px rgba(135, 190, 245, 0.6);
  pointer-events: none;
}

/* Error */
.error-msg {
  padding: 12px 16px;
  background: rgba(255, 80, 80, 0.1);
  border: 1px solid rgba(255, 80, 80, 0.3);
  border-radius: 8px;
  color: #ff5050;
  margin-bottom: 16px;
}

/* Results */
.results {
  margin: 24px 0;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.water-body-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: rgba(212, 175, 55, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  margin-bottom: 12px;
  transition: all 0.3s;
  cursor: pointer;
}

.water-body-card:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--gold);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2);
}

.body-info {
  flex: 1;
  min-width: 0;
}

.body-info h3 {
  color: white;
  font-size: 18px;
  font-family: 'Josefin_Bold', sans-serif;
  margin: 0 0 6px;
}

.body-info p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  margin: 0;
  font-family: 'Josefin_Light', sans-serif;
}

.body-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Josefin_Medium', sans-serif;
  white-space: nowrap;
}

.badge-launch {
  background: rgba(100, 200, 255, 0.15);
  color: #64c8ff;
  border: 1px solid rgba(100, 200, 255, 0.3);
}

.badge-rental {
  background: rgba(120, 180, 255, 0.15);
  color: #78b4ff;
  border: 1px solid rgba(120, 180, 255, 0.3);
}

.badge-paddle {
  background: rgba(80, 255, 200, 0.15);
  color: #50ffc8;
  border: 1px solid rgba(80, 255, 200, 0.3);
}

.badge-public {
  background: rgba(100, 255, 100, 0.15);
  color: #64ff64;
  border: 1px solid rgba(100, 255, 100, 0.3);
}

.badge-park {
  background: rgba(200, 150, 100, 0.15);
  color: #ffb864;
  border: 1px solid rgba(200, 150, 100, 0.3);
}

.badge-size {
  background: rgba(180, 180, 200, 0.15);
  color: #b4b4c8;
  border: 1px solid rgba(180, 180, 200, 0.3);
}

.body-score {
  font-size: 24px;
  font-weight: 700;
  font-family: 'Josefin_Bold', sans-serif;
  padding: 12px 16px;
  border-radius: 10px;
  min-width: 60px;
  text-align: center;
}

.body-score.loading {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
}

.score-good { background: rgba(80, 255, 120, 0.15); color: #50ff78; }
.score-ok { background: rgba(255, 200, 80, 0.15); color: #ffc850; }
.score-bad { background: rgba(255, 80, 80, 0.15); color: #ff5050; }
.score-unknown { background: rgba(128, 128, 128, 0.15); color: #888; }

/* Actions */
.actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn-secondary, .btn-primary {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.body-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: var(--gold);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-icon:hover {
  background: var(--gold);
  color: var(--dark);
  transform: scale(1.1);
}

.btn-icon.btn-map {
  background: rgba(212, 175, 55, 0.1);
}

.btn-icon.btn-map:hover {
  background: var(--gold);
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 1s linear infinite;
}
