/* Mobile Styles - up to 767px */
@media (max-width: 767px) {
  .container {
    position: relative;
    height: 100vh;
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 60vh;
    max-height: 80vh;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    transform: translateY(calc(100% - 120px));
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 1003;
    flex-shrink: 1;
    display: block !important;
  }

  .sidebar.mobile-expanded {
    transform: translateY(0);
  }

  .sidebar-header {
    padding: 12px 20px 8px;
    border-bottom: none;
    position: relative;
    cursor: pointer;
  }

  .sidebar-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: #dadce0;
    border-radius: 2px;
  }

  .sidebar-header h1 {
    font-size: 18px;
    margin-bottom: 2px;
  }

  .sidebar-header p {
    font-size: 12px;
    margin-bottom: 0;
  }

  .subtitle-text {
    display: none;
  }

  .mobile-toggle {
    display: none;
  }

  .sidebar-content {
    padding: 8px 20px 20px;
    height: calc(100% - 80px);
    overflow-y: auto;
  }

  #map {
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
  }

  /* Mobile sidebar content */
  .sidebar-content {
    padding: 12px 16px;
  }

  .sidebar-header {
    padding: 20px 16px 12px;
  }

  .sidebar-header h1 {
    font-size: 20px;
  }

  /* Mobile buttons */
  .btn {
    padding: 12px 16px;
    font-size: 14px;
    width: 100%;
    justify-content: center;
  }

  .button-row .btn {
    width: auto;
    flex: 1;
  }

  /* Mobile chips */
  .chip {
    padding: 8px 12px;
    font-size: 12px;
  }

  .chip-row {
    gap: 6px;
    margin-bottom: 12px;
  }

  /* Mobile form elements */
  .control-group {
    margin-bottom: 16px;
  }

  .control-group input,
  .control-group select {
    padding: 14px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .time-controls {
    flex-direction: column;
    gap: 8px;
  }

  .time-input {
    width: 100%;
  }

  /* Mobile preferences */
  .preferences-row {
    flex-direction: column;
    gap: 8px;
  }

  .preference-label {
    font-size: 14px;
    padding: 8px 0;
  }

  /* Mobile tour stats */
  .tour-stats {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 12px;
    border-left: 3px solid var(--accent-color);
    box-shadow: 0 1px 3px var(--shadow-color);
    color: var(--text-primary);
  }

  .tour-stops h3 {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .controls h3 {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .control-group {
    margin-bottom: 12px;
  }

  .control-group label {
    font-size: 12px;
    margin-bottom: 6px;
  }

  /* Mobile AI Chat */
  .ai-chat-popup {
    bottom: 90px;
    right: 16px;
    left: 16px;
    width: auto;
    height: 60vh;
    max-height: 500px;
    border-radius: 16px 16px 0 0;
  }

  .ai-chat-bubble {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }

  .chat-header {
    padding: 16px 20px;
  }

  .chat-messages {
    padding: 12px 16px;
  }

  .chat-input-container {
    padding: 12px 16px;
  }

  .chat-input-container input {
    padding: 12px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .chat-suggestions {
    padding: 8px 16px;
    flex-wrap: wrap;
  }

  .suggestion-chip {
    padding: 8px 12px;
    font-size: 12px;
    margin-bottom: 4px;
  }

  /* Mobile FAB */
  .fab {
    bottom: 140px;
    right: 16px;
    left: auto;
    width: 48px;
    height: 48px;
  }

  /* Mobile floating controls */
  .mobile-controls {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 1002;
    display: flex !important;
    gap: 8px;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .mobile-search {
    flex: 1;
    background: white;
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    padding: 0 16px;
  }

  .mobile-search input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 0;
    font-size: 14px;
  }

  .mobile-search .material-icons {
    color: #5f6368;
    margin-right: 8px;
  }

  .mobile-menu-btn {
    width: 48px;
    height: 48px;
    background: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .mobile-menu-btn .material-icons {
    color: #4285f4;
    font-size: 20px;
  }

  /* Mobile bottom sheet handle */
  .bottom-sheet-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .bottom-sheet-handle::after {
    content: '';
    width: 40px;
    height: 4px;
    background: #dadce0;
    border-radius: 2px;
  }

  /* Compact mobile sections */
  .ai-chat-container {
    padding: 12px;
    margin-top: 8px;
  }

  .chat-messages-sidebar {
    max-height: 120px;
    margin-bottom: 8px;
  }

  .welcome-message {
    padding: 6px;
    font-size: 12px;
  }

  .chat-input-sidebar input {
    padding: 8px 12px;
    font-size: 14px;
  }

  .chat-send-sidebar {
    width: 32px;
    height: 32px;
  }

  .chat-suggestions-sidebar .suggestion-chip {
    padding: 4px 8px;
    font-size: 10px;
  }

  /* Mobile map controls */
  .map-controls {
    top: 70px; /* Below mobile toggle */
    right: 16px;
  }

  .traffic-toggle {
    padding: 8px 12px;
    font-size: 12px;
  }

  /* Mobile search suggestions */
  .search-suggestions {
    max-height: 300px;
    border-radius: 8px;
    margin-top: 4px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
  }

  .suggestion-item {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-height: 60px;
    border-bottom: 1px solid var(--border-color);
  }
  
  .suggestion-item:hover {
    background: var(--bg-secondary);
  }

  .suggestion-text {
    font-size: 14px;
    width: 100%;
    color: var(--text-primary);
    line-height: 1.4;
  }

  .suggestion-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .suggestion-btn {
    width: 36px;
    height: 36px;
  }

  /* Mobile transport info */
  .transport-info {
    margin: 12px 0;
    padding: 16px;
    border-radius: 12px;
  }

  /* Mobile footer */
  .footer-text {
    margin-top: 20px;
    padding-top: 20px;
  }

  .footer-small {
    font-size: 11px;
  }

  /* Touch-friendly spacing */
  .control-buttons {
    margin-bottom: 16px;
  }

  /* Hide hover effects on mobile */
  .btn:hover,
  .chip:hover,
  .suggestion-btn:hover,
  .ai-chat-bubble:hover,
  .fab:hover {
    transform: none;
  }
}