html, body { 
  height: 100%; 
  margin: 0; 
  background: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  overflow: hidden;
  position: relative;
  width: 100%;
}

#map-viewport {
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1a1a;
  touch-action: none; /* Prevent iOS default touch behaviors */
}

svg { 
  display: block; 
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  touch-action: none; /* Prevent iOS pinch-zoom on SVG */
}

/* Menu Icon (Hamburger) */
.menu-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(26, 26, 26, 0.95);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.menu-icon:hover {
  background: rgba(40, 40, 40, 0.95);
}

.menu-icon span {
  position: absolute;
  display: block;
  width: 24px;
  height: 3px;
  background: #FFA500;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-icon span:nth-child(1) {
  transform: translateY(-8px);
}

.menu-icon span:nth-child(2) {
  transform: translateY(0);
}

.menu-icon span:nth-child(3) {
  transform: translateY(8px);
}

.menu-icon.active span:nth-child(1) {
  transform: translateY(0) rotate(45deg);
}

.menu-icon.active span:nth-child(2) {
  opacity: 0;
}

.menu-icon.active span:nth-child(3) {
  transform: translateY(0) rotate(-45deg);
}

/* City selector panel */
#city-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background: rgba(26, 26, 26, 0.98);
  padding: 20px;
  box-sizing: border-box;
  z-index: 1000;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
  color: white;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

#city-panel.panel-visible {
  transform: translateX(0);
}

#city-panel.panel-hidden {
  transform: translateX(100%);
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  #city-panel {
    width: 66%;
    padding: 15px;
    font-size: 14px;
  }
  
  .menu-icon {
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
  }
  
  .menu-icon span {
    width: 20px;
  }
  
  .panel-title {
    font-size: 16px !important;
  }
  
  #city-panel h3 {
    font-size: 15px !important;
  }
  
  .coord-inputs input {
    font-size: 12px !important;
  }
  
  .location-btn,
  #set-location-btn,
  #clear-all-btn {
    font-size: 12px !important;
    padding: 6px 10px !important;
  }
  
  .city-item {
    font-size: 12px !important;
  }
  
  .selected-city .city-name {
    font-size: 13px !important;
  }
  
  .selected-city .sunset-time {
    font-size: 14px !important;
  }
}

@media (max-width: 480px) {
  #city-panel {
    padding: 12px;
    font-size: 13px;
  }
  
  .panel-title {
    font-size: 15px !important;
  }
  
  #city-panel h3 {
    font-size: 14px !important;
  }
}

.panel-main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  user-select: none;
}

.panel-close-btn {
  background: none;
  border: none;
  color: #FFA500;
  font-size: 32px;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.2s;
}

.panel-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}

#city-panel h3 {
  margin: 0 0 15px 0;
  font-size: 18px;
  font-weight: 600;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.panel-header h3 {
  margin: 0;
}

#clear-all-btn {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid #ff4444;
  border-radius: 4px;
  color: #ff4444;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

#clear-all-btn:hover {
  background: #ff4444;
  color: white;
}

#city-search {
  width: 100%;
  padding: 10px;
  background: #333;
  border: 1px solid #555;
  border-radius: 6px;
  color: white;
  font-size: 14px;
  margin-bottom: 15px;
  box-sizing: border-box;
}

#city-search:focus {
  outline: none;
  border-color: #FFA500;
}

#city-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.city-item {
  padding: 8px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 4px;
}

.city-item:hover {
  background: #333;
}

#selected-cities {
  margin-top: 20px;
}

.selected-city {
  background: #2a2a2a;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  position: relative;
}

.selected-city .city-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 5px;
}

.selected-city .sunset-time {
  color: #FFA500;
  font-size: 16px;
  font-weight: 500;
}

.selected-city .remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ff4444;
  border: none;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 20px;
  padding: 0;
}

.selected-city .remove-btn:hover {
  background: #ff6666;
}

/* My Location section */
#my-location-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #444;
}

#my-location-section h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 600;
}

.location-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.location-btn {
  flex: 1;
  padding: 8px 12px;
  background: #FFA500;
  border: none;
  border-radius: 6px;
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.location-btn:hover {
  background: #FFB733;
}

.location-btn:disabled {
  background: #555;
  color: #999;
  cursor: not-allowed;
}

.manual-location {
  margin-top: 10px;
}

.manual-location label {
  display: block;
  font-size: 12px;
  color: #999;
  margin-bottom: 5px;
}

.coord-inputs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.coord-inputs input {
  flex: 1;
  padding: 8px;
  background: #333;
  border: 1px solid #555;
  border-radius: 4px;
  color: white;
  font-size: 13px;
}

.coord-inputs input:focus {
  outline: none;
  border-color: #FFA500;
}

.coord-inputs input::placeholder {
  color: #666;
}

#set-location-btn {
  width: 100%;
  padding: 8px;
  background: #4CAF50;
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#set-location-btn:hover {
  background: #5CBF60;
}

#my-location-display {
  margin-top: 10px;
  padding: 12px;
  background: #2a2a2a;
  border-radius: 8px;
  border-left: 3px solid #4CAF50;
  display: none;
  position: relative;
}

#my-location-display.active {
  display: block;
}

#my-location-display .location-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 5px;
  color: #4CAF50;
}

#my-location-display .location-coords {
  font-size: 11px;
  color: #999;
  margin-bottom: 5px;
}

#my-location-display .location-sunset {
  color: #FFA500;
  font-size: 16px;
  font-weight: 500;
}

#my-location-display .remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ff4444;
  border: none;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 20px;
  padding: 0;
}

#my-location-display .remove-btn:hover {
  background: #ff6666;
}

#my-location-display .location-coords {
  font-size: 11px;
  color: #999;
  margin-bottom: 5px;
}

#my-location-display .location-sunset {
  color: #FFA500;
  font-size: 16px;
  font-weight: 500;
}

.location-error {
  margin-top: 8px;
  padding: 8px;
  background: rgba(255, 68, 68, 0.2);
  border-radius: 4px;
  color: #ff8888;
  font-size: 12px;
  display: none;
}

.location-error.active {
  display: block;
}

/* Pulsating animation for cities near sunset */
@keyframes pulsate-outer {
  0%, 100% {
    opacity: 0.1;
  }
  50% {
    opacity: 0.05;
  }
}

@keyframes pulsate-middle {
  0%, 100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.1;
  }
}

@keyframes pulsate-inner {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.15;
  }
}

@keyframes pulsate-dot {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.sunset-near-outer {
  animation: pulsate-outer 2s ease-in-out infinite;
}

.sunset-near-middle {
  animation: pulsate-middle 2s ease-in-out infinite;
}

.sunset-near-inner {
  animation: pulsate-inner 2s ease-in-out infinite;
}

.sunset-dot-pulsate {
  animation: pulsate-dot 2s ease-in-out infinite;
}
