/* ========== RESET & BASE ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========== DEVICE RESTRICTION (Portrait only) ========== */
.device-restriction {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1a2a3a;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

/* Show restriction on landscape or large screens */
@media (orientation: landscape) or (min-width: 768px) {
  .device-restriction {
    display: flex;
  }
  .app-container {
    display: none;
  }
}

/* For phones in portrait */
@media (orientation: portrait) and (max-width: 767px) {
  .device-restriction {
    display: none;
  }
  .app-container {
    display: flex;
  }
}

/* ========== APP CONTAINER ========== */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  max-width: 450px;
  margin: 0 auto;
  background: #f5f0e8;
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ========== HEADER ========== */
header {
  background: #2e7d64;
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.logo img {
  height: 36px;
  width: auto;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: flex;
  gap: 4px;
}

.lang-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.lang-btn.active {
  background: white;
  color: #2e7d64;
  font-weight: bold;
}

.toggle-keypad-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.toggle-keypad-btn:hover,
.toggle-keypad-btn:active {
  background: rgba(255,255,255,0.3);
}

.keypad-icon {
  font-size: 1.3rem;
  color: white;
}

/* ========== MAP CONTAINER ========== */
.map-container {
  flex: 1;
  position: relative;
  min-height: 0;
}

#map {
  width: 100%;
  height: 100%;
  background: #c8e0e0;
}

.location-status {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  border-radius: 30px;
  padding: 8px 16px;
  z-index: 1000;
  pointer-events: none;
}

.location-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 0.75rem;
}

.location-icon {
  font-size: 1rem;
}

/* ========== INFO PANEL ========== */
.info-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 450px;
  margin: 0 auto;
  background: white;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  z-index: 2000;
  max-height: 70vh;
  overflow-y: auto;
  transition: transform 0.3s ease;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.panel-close {
  position: sticky;
  top: 12px;
  right: 12px;
  float: right;
  background: #e74c3c;
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 2001;
  margin: 12px;
}

.panel-content {
  padding: 20px;
  padding-top: 0;
  clear: both;
}

.panel-content h3 {
  color: #2e7d64;
  font-size: 0.85rem;
  margin: 0 0 4px 0;
  letter-spacing: 1px;
}

.panel-content h1 {
  font-size: 1.4rem;
  margin: 0 0 8px 0;
  color: #1a2a3a;
}

.panel-content img {
  width: 100%;
  border-radius: 16px;
  margin: 12px 0;
  max-height: 180px;
  object-fit: cover;
  background: #f0ebe3;
}

.panel-content audio {
  width: 100%;
  margin: 10px 0;
}

.panel-content p {
  color: #444;
  line-height: 1.5;
  margin: 12px 0;
  font-size: 0.9rem;
}

/* ========== ACCORDION ========== */
.accordion-section {
  background: #f0ebe3;
  border-radius: 16px;
  margin: 16px 0;
  overflow: hidden;
}

.accordion-btn {
  width: 100%;
  background: #e0d5c8;
  border: none;
  padding: 12px 16px;
  text-align: left;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #2e5d4a;
}

.accordion-content {
  display: none;
  padding: 16px;
  background: white;
  border-top: 1px solid #e0d5c8;
}

.accordion-content.show {
  display: block;
}

.accordion-content p {
  font-size: 0.85rem;
  margin-bottom: 12px;
}

/* ========== KEYPAD ========== */
.keypad {
  position: fixed;
  top: 70px;
  right: 12px;
  background: #2c2e3a;
  padding: 12px;
  border-radius: 20px;
  display: none;
  z-index: 1000;
  width: 220px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.input-display {
  background: #1f1b16;
  color: #ffd966;
  text-align: center;
  padding: 8px;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  font-weight: bold;
}

.keypad-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.keypad-container button {
  background: #0f0a1f;
  color: white;
  border: none;
  font-size: 1.3rem;
  font-weight: bold;
  padding: 10px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.1s;
}

.keypad-container button:active {
  background: #3a2e4a;
}

.keypad .clear,
.keypad .enter {
  font-size: 0.85rem;
}

.keypad .clear { background: #db8449; }
.keypad .enter { background: #2a7f49; }

/* ========== FOOTER ========== */
footer {
  background: #2e7d64;
  text-align: center;
  padding: 8px;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.8);
  flex-shrink: 0;
}

/* ========== CUSTOM MAP ICON STYLES ========== */
.custom-location-icon {
  background: transparent;
  border: none;
  font-size: 32px;
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.custom-stop-icon {
  background: transparent;
  border: none;
  font-size: 0;
}

.custom-spot-icon {
  background: transparent;
  border: none;
  font-size: 0;
}

/* Leaflet popup/tooltip customization */
.leaflet-tooltip {
  background: #2e7d64;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: bold;
}

.leaflet-tooltip-top:before {
  border-top-color: #2e7d64;
}

/* Loading overlay */
.map-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  color: white;
  font-size: 0.9rem;
}