@media (orientation: landscape) {
  #app-container {
    display: flex !important;
    flex-direction: row-reverse !important; /* Swapped from row to row-reverse */
    padding: var(--app-padding, 12px) !important;
    gap: var(--app-gap, 12px) !important;
    box-sizing: border-box !important;
    overflow: hidden !important; 
  }

  #mainContent {
    position: relative !important; 
    width: 320px !important; /* Set width to 320px */
    min-width: 0; /* Allow the element to shrink below its content size */
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    top: auto; left: auto; right: auto; bottom: auto;
    transform: none !important;
    margin: 0 !important;
    border-radius: 24px !important;
    box-shadow: -2px 0 15px rgba(0,0,0,0.1) !important; /* Adjusted shadow for right side */
    z-index: 200 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    overflow-x: hidden !important; 
    overflow-y: hidden !important; 
  }

  #mainContent h1 {
    position: static !important;
    transform: none !important;
    margin-top: 15px !important;
    margin-bottom: 2px !important;
  }
  
  #results {
    flex: 1 !important;
    overflow-y: auto !important; 
    overflow-x: hidden !important; 
    padding: 10px 0 !important; 
    margin-top: 10px !important;
    width: 100% !important;
    scrollbar-width: thin !important;
    align-content: flex-start !important; 
  }

  #dragHandle {
    display: none !important;
  }

  #searchContainer {
    margin-top: 0 !important; /* Set top margin to 0 to remove the gap */
    width: calc(100% - 24px) !important; 
    margin-left: auto !important;
    margin-right: auto !important;
  }

  #map-wrapper {
    flex: 1 !important;
    height: 100% !important;
    border-radius: 24px !important;
    overflow: hidden !important; 
    position: relative !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
    z-index: 100!important;
  }

  #map {
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important; 
    left: 0 !important;
    border-radius: 0 !important; 
  }

  #mapControls {
    position: absolute !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    max-width: 90% !important;
  }

  #updateCountdown {
    position: absolute !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  .station {
    width: calc(100% - 24px) !important;
    margin: 0 auto 12px auto !important; 
  }
}

.pulsing-icon {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

@media (max-width: 768px) {
  
  .station {
    width: calc(100% - 20px) !important; /* Added !important */
  }
  
  #searchContainer {
    padding: 8px 12px;
  }

  #keyword {
    width: calc(100% - 34px);
    margin-right: 0;
    margin-bottom: 0;
    border-radius: 28px;
    display: block;
    padding: 0 12px;
  }

  #searchIcon {
    position: static;
    margin-left: 10px;
    margin-top: 0;
    align-self: auto;
    font-size: 24px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #results {
    gap: 10px;
  }

  .station {
    margin-bottom: 10px;
  }
}

@media (max-width: 480px) {
  #mainContent h1 {
    top: 5px !important; 
    font-size: 1.2em !important;
  }

  #results {
    padding: 0 16px;
  }

  #results .station {
    width: calc(100% - 20px) !important;
    margin: 8px auto !important;
    padding: 12px !important;
  }

  #results .station h3 {
    font-size: 1em !important;
    margin-bottom: 5px !important;
  }

  #searchContainer {
    padding: 10px;
  }
  
  #keyword {
    width: calc(100% - 34px);
    padding: 0 10px;
  }
}
