:root {
  --primary-color: #FF6B35; /* Vibrant orange - represents food/excitement */
  --primary-hover: #E85826; /* Darker orange for hover states */
  --secondary-color: #2EC4B6; /* Teal - represents travel/water */
  --secondary-hover: #20B2A5; /* Darker teal for hover states */
  --accent-color: #FFBC42; /* Warm yellow - represents sunshine/warmth */
  
  --sidebar-bg: #20293A; /* Dark blue-gray for main sidebar */
  --child-sidebar-bg: #FDFDFD; /* Off-white for child sidebar */
  --background: #F7F9FC; /* Light background for content */
  
  --text-primary: #293241; /* Dark blue-gray for primary text */
  --text-secondary: #5C677D; /* Medium gray for secondary text */
  --text-light: #FFFFFF; /* White text for dark backgrounds */
  
  --border-color: #E2E8F0;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  
  --radius: 8px;
  --transition-speed: 0.3s;
  --mobile-nav-height: 60px;
  
  --main-sidebar-width: 220px;
  --main-sidebar-collapsed-width: 70px;
  --child-sidebar-width: 360px;
}

/* Base Styles */
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  min-height: 100vh;
  background: var(--background);
  color: var(--text-primary);
}

/* Main Feature Sidebar */
.main-sidebar {
  width: var(--main-sidebar-width);
  padding: 1.5rem 1rem;
  background: var(--sidebar-bg);
  color: var(--text-light);
  box-shadow: var(--shadow-md);
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  z-index: 10;
  display: flex;
  flex-direction: column;
  transition: width var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.main-sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}

.main-sidebar.collapsed {
  width: var(--main-sidebar-collapsed-width);
}

.main-sidebar.collapsed .feature-text,
.main-sidebar.collapsed .logo-text {
  display: none;
}

.main-sidebar.collapsed .feature-item {
  justify-content: center;
}

.main-sidebar.collapsed .feature-item .material-icons {
  margin-right: 0;
}

/* Toggle Sidebar Buttons */
.toggle-sidebar {
  position: absolute;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.toggle-sidebar:hover {
  background: var(--background);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.toggle-sidebar:active {
  transform: scale(0.95);
}

.toggle-sidebar .material-icons {
  color: var(--text-secondary);
}

/* Larger toggle button for child sidebar */
.child-sidebar .toggle-sidebar {
  right: -20px;
  top: 20px;
  width: 40px;
  height: 40px;
  background: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 6;
}

.child-sidebar .toggle-sidebar .material-icons {
  font-size: 24px;
}

/* Adjust main sidebar toggle button for consistency */
.main-sidebar .toggle-sidebar {
  right: -20px;
  top: 70px;
  width: 40px;
  height: 40px;
  z-index: 12;
}

.main-sidebar .toggle-sidebar .material-icons {
  font-size: 24px;
}

.main-sidebar .toggle-sidebar {
  transform: rotate(0deg);
  transition: transform var(--transition-speed) ease, background 0.2s ease, box-shadow 0.2s ease;
}

.main-sidebar.collapsed .toggle-sidebar {
  transform: rotate(180deg);
}

.child-sidebar .toggle-sidebar {
  transition: transform var(--transition-speed) ease, background 0.2s ease, box-shadow 0.2s ease;
}

.child-sidebar.collapsed .toggle-sidebar {
  transform: rotate(180deg);
}

/* Logo */
.logo {
  text-align: center;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo h2 {
  font-size: 1.25rem;
  margin: 0;
  white-space: nowrap;
}

/* Feature Navigation */
.feature-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
}

.feature-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.15);
}

.feature-item.active {
  background: var(--primary-color);
  color: var(--text-light);
}

.feature-item .material-icons {
  margin-right: 0.75rem;
}

/* User Section */
.user-section {
  margin-top: auto;
  padding-top: 1rem;
}

#logout-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-sidebar.collapsed #logout-btn {
  justify-content: center;
}

.main-sidebar.collapsed #logout-btn .feature-text {
  display: none;
}

#logout-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

#logout-btn .material-icons {
  margin-right: 0.5rem;
}

.main-sidebar.collapsed #logout-btn .material-icons {
  margin-right: 0;
}

/* Child Sidebar */
.child-sidebar {
  width: var(--child-sidebar-width);
  padding: 2.5rem;
  background: var(--child-sidebar-bg);
  box-shadow: var(--shadow-md);
  position: fixed;
  left: var(--main-sidebar-width);
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal scrolling */
  box-sizing: border-box;
  border-right: 1px solid var(--border-color);
  z-index: 5;
  transition: left var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.main-sidebar.collapsed + .child-sidebar {
  left: var(--main-sidebar-collapsed-width);
}

.child-sidebar.collapsed {
  transform: translateX(calc(-100% + 15px));
}

.feature-sidebar {
  display: none;
  width: 100%;
  overflow-x: hidden; /* Prevent horizontal scrolling */
  box-sizing: border-box;
}

.feature-sidebar.active {
  display: block;
}

/* Feature sidebar headings */
.feature-sidebar h1::before {
  display: block;
  text-align: center;
  margin-bottom: 0.5rem;
  font-size: 2rem;
}

#eat-sidebar h1::before {
  content: "🍜";
}

#visit-sidebar h1::before {
  content: "🗺️";
}

#plan-sidebar h1::before {
  content: "✈️";
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: calc(var(--main-sidebar-width) + var(--child-sidebar-width));
  padding: 2rem;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-speed) ease;
  background: var(--background);
  width: calc(100% - var(--main-sidebar-width) - var(--child-sidebar-width));
}

.main-sidebar.collapsed ~ .main-content {
  margin-left: calc(var(--main-sidebar-collapsed-width) + var(--child-sidebar-width));
  width: calc(100% - var(--main-sidebar-collapsed-width) - var(--child-sidebar-width));
}

.main-sidebar.collapsed ~ .child-sidebar.collapsed ~ .main-content {
  margin-left: var(--main-sidebar-collapsed-width);
  width: calc(100% - var(--main-sidebar-collapsed-width));
}

.child-sidebar.collapsed ~ .main-content {
  margin-left: var(--main-sidebar-width);
  width: calc(100% - var(--main-sidebar-width));
}

/* Headings */
h1, h2 {
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 2.5rem;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

h1::after, h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--primary-color);
  margin: 0.5rem auto 0;
  border-radius: 3px;
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding-left: 0.5rem;
}

.form-group label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0.8em;
  background: var(--primary-color);
  border-radius: 3px;
}

input, select {
  width: 100%;
  max-width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background: white;
  box-sizing: border-box; /* Important for preventing overflow */
}

input::placeholder {
  color: #94a3b8;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Buttons */
button {
  background: var(--primary-color);
  color: var(--text-light);
  border: none;
  padding: 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
}

button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

button:active {
  transform: translateY(0);
}

/* Secondary buttons (for "Where to Go" feature) */
#visit-sidebar button {
  background: var(--secondary-color);
}

#visit-sidebar button:hover {
  background: var(--secondary-hover);
}

/* Content tabs styling */
.content-tabs {
  display: flex;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
  background: white;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.tab-button {
  flex: 1;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 1rem;
  font-weight: 600;
  margin: 0;
  transition: all 0.2s ease;
  position: relative;
  border-bottom: 3px solid transparent;
}

.tab-button:hover {
  background: rgba(255, 107, 53, 0.05);
  color: var(--text-primary);
  transform: none;
  box-shadow: none;
}

.tab-button.active {
  color: var(--primary-color);
  background: white;
  border-bottom: 3px solid var(--primary-color);
}

.tab-button:first-child {
  border-top-left-radius: var(--radius);
}

.tab-button:last-child {
  border-top-right-radius: var(--radius);
}

.tab-button .material-icons {
  margin-right: 0.5rem;
  font-size: 18px;
  vertical-align: middle;
}

/* Tab content containers */
.tab-content {
  display: none;
  height: calc(100vh - 200px); /* Adjust based on your header/tabs height */
  background: white;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
/* Tab content containers (continued) */
.tab-content.active {
  display: block;
}

/* Map view styling */
.markmap-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.markmap {
  width: 100%;
  height: 100%;
  background: white;
}

/* Detail view styling */
.markdown-content {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.markdown-container {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

.markdown-container h1,
.markdown-container h2,
.markdown-container h3 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.markdown-container h1::after,
.markdown-container h2::after,
.markdown-container h3::after {
  width: 40px;
  margin-top: 0.3rem;
}

.markdown-container p {
  margin-bottom: 1rem;
}

.markdown-container ul, 
.markdown-container ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.markdown-container code {
  background: var(--background);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

.markdown-container pre {
  background: var(--background);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1rem;
}

.markdown-container table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.markdown-container th,
.markdown-container td {
  border: 1px solid var(--border-color);
  padding: 0.5rem;
}

.markdown-container th {
  background: var(--background);
}

/* Loading indicator */
#loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 1.5rem 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-left: 4px solid var(--primary-color);
}

#loading::after {
  content: "";
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--primary-color);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Content Placeholders */
.content-placeholder {
  display: none;
  width: 100%;
  flex: 1;
}

.content-placeholder.active {
  display: block;
}

/* Food and Place Grids */
.food-grid, .place-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.food-card, .place-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.food-card:hover, .place-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.food-image, .place-image {
  height: 180px;
  background-color: #e2e8f0;
  position: relative;
  overflow: hidden;
}

.food-image.placeholder, .place-image.placeholder {
  animation: pulse 1.5s infinite alternate;
}

.food-image::after, .place-image::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.3));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.food-card:hover .food-image::after, 
.place-card:hover .place-image::after {
  opacity: 1;
}

@keyframes pulse {
  0% {
      background-color: #e2e8f0;
  }
  100% {
      background-color: #f1f5f9;
  }
}

.food-card h3, .place-card h3 {
  padding: 1rem 1rem 0.5rem;
  margin: 0;
  font-size: 1.1rem;
}

.food-grid .food-card:nth-child(3n+1) h3 {
  border-left: 3px solid var(--primary-color);
  padding-left: 10px;
}

.food-grid .food-card:nth-child(3n+2) h3 {
  border-left: 3px solid var(--secondary-color);
  padding-left: 10px;
}

.food-grid .food-card:nth-child(3n+3) h3 {
  border-left: 3px solid var(--accent-color);
  padding-left: 10px;
}

.place-grid .place-card:nth-child(3n+1) h3 {
  border-left: 3px solid var(--primary-color);
  padding-left: 10px;
}

.place-grid .place-card:nth-child(3n+2) h3 {
  border-left: 3px solid var(--secondary-color);
  padding-left: 10px;
}

.place-grid .place-card:nth-child(3n+3) h3 {
  border-left: 3px solid var(--accent-color);
  padding-left: 10px;
}

.food-card p, .place-card p {
  padding: 0 1rem 1rem;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Content hint */
.content-hint {
  margin-top: 2rem;
  text-align: center;
  padding: 1rem;
  background: rgba(255, 107, 53, 0.05);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary-color);
}

.content-hint p {
  margin: 0;
  color: var(--text-secondary);
}

/* Auth styles - updated for full-screen experience */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--background);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000; /* Ensure it's above everything else */
  padding: 1rem;
  box-sizing: border-box;
  background-image: linear-gradient(45deg, rgba(255, 107, 53, 0.05) 25%, transparent 25%, transparent 50%, rgba(255, 107, 53, 0.05) 50%, rgba(255, 107, 53, 0.05) 75%, transparent 75%, transparent);
  background-size: 40px 40px;
}

.auth-form {
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 400px;
  border-top: 4px solid var(--primary-color);
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-form h2 {
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--text-primary);
}

.auth-form .form-group {
  margin-bottom: 1.25rem;
}

.auth-form label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 0.5rem;
}

.auth-form label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0.8em;
  background: var(--primary-color);
  border-radius: 3px;
}

.auth-form input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.auth-form button {
  width: 100%;
  padding: 0.875rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.2s ease;
}

.auth-form button:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.auth-form button:active {
  transform: translateY(0);
}

.auth-form p {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-secondary);
}

.auth-form a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.auth-form a:hover {
  text-decoration: underline;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin: 0;
}

/* Logo animation for auth page */
.logo-emoji {
  display: inline-block;
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* Mobile Bottom Navigation - Updated to hide when not authenticated */
.mobile-bottom-nav {
  display: none;
}

/* Only show bottom nav when authenticated and on mobile */
@media (max-width: 768px) {
  .authenticated .mobile-bottom-nav {
    display: flex;
  }
  
  /* Add authenticated class styles */
  body.authenticated {
    padding-bottom: 70px; /* Account for bottom nav */
  }
}

/* Mobile Navigation */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--mobile-nav-height);
  background: var(--sidebar-bg);
  color: var(--text-light);
  z-index: 100;
  box-shadow: var(--shadow-md);
  align-items: center;
  justify-content: center; /* Changed from space-between to center */
  padding: 0 1rem;
}

.mobile-title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-light);
}

.app-container {
  display: flex;
  width: 100%;
  height: 100%;
  background: var(--background);
}

/* Mobile Navigation */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--mobile-nav-height);
  background: var(--sidebar-bg);
  color: var(--text-light);
  z-index: 100;
  box-shadow: var(--shadow-md);
  align-items: center;
  justify-content: center; /* Changed from space-between to center */
  padding: 0 1rem;
}

.mobile-title {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-light);
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  display: none;
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  background-color: var(--sidebar-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  height: 70px;
}

.mobile-bottom-nav .nav-item {
  padding: 10px 0;
  text-align: center;
  flex: 1;
  color: var(--text-light);
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mobile-bottom-nav .nav-item.active {
  opacity: 1;
  border-top: 3px solid var(--primary-color);
}

.mobile-bottom-nav .nav-item .material-icons {
  font-size: 24px;
  margin-bottom: 2px;
}

.mobile-bottom-nav .nav-item p {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

/* Completely new responsive approach */
@media (max-width: 1200px) {
  /* Large screens but not full desktop */
  .main-sidebar {
    width: var(--main-sidebar-collapsed-width);
  }
  
  .main-sidebar .feature-text,
  .main-sidebar .logo-text {
    display: none;
  }
  
  .main-sidebar .feature-item {
    justify-content: center;
  }
  
  .main-sidebar .feature-item .material-icons {
    margin-right: 0;
  }
  
  .child-sidebar {
    left: var(--main-sidebar-collapsed-width);
  }
  
  .main-content {
    margin-left: calc(var(--main-sidebar-collapsed-width) + var(--child-sidebar-width));
    width: calc(100% - var(--main-sidebar-collapsed-width) - var(--child-sidebar-width));
  }
  
  .child-sidebar.collapsed ~ .main-content {
    margin-left: var(--main-sidebar-collapsed-width);
    width: calc(100% - var(--main-sidebar-collapsed-width));
  }
}

@media (max-width: 992px) {
  /* Tablets and smaller desktops */
  .child-sidebar {
    width: 280px;
  }
  
  .main-content {
    margin-left: calc(var(--main-sidebar-collapsed-width) + 280px);
    width: calc(100% - var(--main-sidebar-collapsed-width) - 280px);
  }
  
  .child-sidebar.collapsed ~ .main-content {
    margin-left: var(--main-sidebar-collapsed-width);
    width: calc(100% - var(--main-sidebar-collapsed-width));
  }
}

@media (max-width: 768px) {
  /* Mobile view basics */
  body {
    padding-top: var(--mobile-nav-height);
    overflow-x: hidden;
  }
  
  /* Show mobile nav */
  .mobile-nav {
    display: flex;
  }
  
  /* Adjust main layout */
  .main-sidebar {
    display: none; /* Hide main sidebar on mobile */
  }
  
  .child-sidebar {
    display: none; /* Hide by default on mobile */
    position: fixed;
    top: var(--mobile-nav-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--mobile-nav-height));
    padding: 1rem;
    z-index: 100;
    background: white;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  
  /* When feature sidebar is shown on mobile */
  .feature-sidebar.active.mobile-visible {
    display: block;
  }
  
  /* Main content area */
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  /* Mobile menu overlay */
  .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: none;
  }
  
  .mobile-menu-overlay.active {
    display: block;
  }
  
  /* Mobile side menu */
  .mobile-menu {
    position: fixed;
    top: 0;
    left: -85%;
    width: 85%;
    max-width: 300px;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background: white;
    z-index: 201;
    transition: left 0.3s ease;
    box-sizing: border-box;
  }
  
  .mobile-menu-overlay.active .mobile-menu {
    left: 0;
  }
  
  /* Mobile form inputs and buttons */
  .form-group {
    margin-bottom: 1rem;
  }
  
  input, select, button {
    font-size: 16px; /* Better size for mobile */
    min-height: 44px; /* Better touch targets */
  }
  
  /* Mobile food and place cards */
  .food-grid, .place-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Tab content for mobile */
  .tab-content {
    height: auto;
    min-height: 300px; /* Minimum reasonable height */
  }
  
  /* Content tabs mobile styling */
  .content-tabs {
    margin-bottom: 1rem;
  }
  
  .tab-button {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
  }
  
  /* Mobile markmap fix */
  .markmap-container, .markmap {
    height: 500px;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  /* Adjust child sidebar to account for bottom nav on mobile */
  .child-sidebar {
    height: calc(100vh - var(--mobile-nav-height) - 70px);
    bottom: 70px;
    top: auto;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    left: 0;
    width: 100%;
    z-index: 200; /* Ensure it's above other content */
  }
  
  .child-sidebar.mobile-visible {
    transform: translateY(0);
    display: block;
    opacity: 1;
    pointer-events: auto;
    transition: transform 0.3s ease;
  }
  
  /* Add initial animation class for first-time display */
  .child-sidebar.initial-show {
    animation: slideUpInitial 0.4s ease forwards;
  }
  
  @keyframes slideUpInitial {
    from {
      transform: translateY(100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  /* Hide the toggle button on mobile since we're using swipe and handle */
  .child-sidebar .toggle-sidebar {
    display: none;
  }
  
  /* Make sure the mobile-close handle is prominent */
  .child-sidebar .mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
  }
  
  .child-sidebar .mobile-close .handle {
    width: 50px;
    height: 5px;
    background-color: var(--border-color);
    border-radius: 10px;
    cursor: pointer; /* Add cursor pointer to make it clear it's interactive */
  }

  /* Hide scrollbars for Chrome, Safari and Opera */
  ::-webkit-scrollbar {
    width: 0;
    background: transparent;
    display: none;
  }
  
  /* Hide scrollbars for Firefox */
  * {
    scrollbar-width: none;
  }
  
  /* Hide scrollbars for IE and Edge */
  * {
    -ms-overflow-style: none;
  }
  
  /* Ensure content is still scrollable */
  .child-sidebar, .main-content, .tab-content, .markdown-content {
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .form-group label {
    font-size: 0.8rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.25rem;
  }
  
  .mobile-title {
    font-size: 1.1rem;
  }
  
  .mobile-menu {
    width: 85%;
  }
  
  .tab-button {
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
  }
  
  .tab-button .material-icons {
    font-size: 16px;
  }
  
  /* Prevent long content from causing overflow */
  h1, h2, h3, p, label {
    word-break: break-word;
    max-width: 100%;
  }
}

/* Utility classes */
.no-scroll {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* Child sidebar on mobile */
.child-sidebar.mobile-visible {
  display: block;
}

.mobile-bottom-nav {
  display: none;
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  background-color: var(--sidebar-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  height: 70px;
}

.mobile-bottom-nav .nav-item {
  padding: 10px 0;
  text-align: center;
  flex: 1;
  color: var(--text-light);
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mobile-bottom-nav .nav-item.active {
  opacity: 1;
  border-top: 3px solid var(--primary-color);
}

.mobile-bottom-nav .nav-item .material-icons {
  font-size: 24px;
  margin-bottom: 2px;
}

.mobile-bottom-nav .nav-item p {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
}

/* Adjust main content to account for bottom navigation on mobile */
@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }
  
  /* Adjust main content to account for bottom nav */
  .main-content {
    padding-bottom: 90px;
  }
  
  /* Adjust child sidebar to account for bottom nav on mobile */
  .child-sidebar {
    height: calc(100vh - var(--mobile-nav-height) - 70px);
    bottom: 70px;
    top: auto;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    left: 0;
    width: 100%;
  }
  
  .child-sidebar.mobile-visible {
    transform: translateY(0);
    display: block;
  }
  
  /* Close button for mobile child sidebar */
  .child-sidebar .mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
  }
  
  .child-sidebar .mobile-close .handle {
    width: 50px;
    height: 5px;
    background-color: var(--border-color);
    border-radius: 10px;
  }
}

/* Small screen mobile adjustments */
@media (max-width: 480px) {
  /* Ensure bottom nav text is readable */
  .mobile-bottom-nav .nav-item p {
    font-size: 11px;
  }
  
  .mobile-bottom-nav .nav-item .material-icons {
    font-size: 22px;
  }
}

/* Custom scrollbar - Updated to hide on mobile but keep functionality */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

/* Hide scrollbars on mobile but keep scrolling functionality */
@media (max-width: 768px) {
  /* Hide scrollbars for Chrome, Safari and Opera */
  ::-webkit-scrollbar {
    width: 0;
    background: transparent;
    display: none;
  }
  
  /* Hide scrollbars for Firefox */
  * {
    scrollbar-width: none;
  }
  
  /* Hide scrollbars for IE and Edge */
  * {
    -ms-overflow-style: none;
  }
  
  /* Ensure content is still scrollable */
  .child-sidebar, .main-content, .tab-content, .markdown-content {
    -webkit-overflow-scrolling: touch;
  }
}

/* Mobile Bottom Navigation - Enhanced for smoothness */
.mobile-bottom-nav {
  display: none;
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  background-color: var(--sidebar-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.15); /* Enhanced shadow */
  height: 70px;
  transition: transform 0.3s ease;
}

.mobile-bottom-nav .nav-item {
  padding: 10px 0;
  text-align: center;
  flex: 1;
  color: var(--text-light);
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative; /* For pseudo-element positioning */
}

/* Enhanced active state border for mobile bottom nav */
.mobile-bottom-nav .nav-item.active {
  opacity: 1;
}

.mobile-bottom-nav .nav-item.active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 0 0 3px 3px;
}

.mobile-bottom-nav .nav-item .material-icons {
  font-size: 24px;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

/* Subtle feedback when tapping navigation items */
.mobile-bottom-nav .nav-item:active .material-icons {
  transform: scale(0.9);
}

.mobile-bottom-nav .nav-item p {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
}

/* Enhanced styling for child sidebar on mobile */
@media (max-width: 768px) {
  /* ...existing mobile sidebar code... */

  /* Enhanced border radius for child sidebar */
  .child-sidebar {
    height: calc(100vh - var(--mobile-nav-height) - 70px);
    bottom: 70px;
    top: auto;
    border-top-left-radius: 20px; /* Increased radius */
    border-top-right-radius: 20px; /* Increased radius */
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.15); /* Enhanced shadow */
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.21, 1.02, 0.73, 0.99); /* Smoother easing */
    left: 0;
    width: 100%;
    z-index: 200;
    overflow-y: auto;
    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  /* Hide scrollbar for Chrome, Safari and Opera */
  .child-sidebar::-webkit-scrollbar {
    display: none;
  }
  
  .child-sidebar.mobile-visible {
    transform: translateY(0);
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
  
  /* Enhanced animation for initial show */
  .child-sidebar.initial-show {
    animation: slideUpInitial 0.4s cubic-bezier(0.21, 1.02, 0.73, 0.99) forwards; /* Smoother easing */
  }
  
  @keyframes slideUpInitial {
    from {
      transform: translateY(100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  /* Enhanced handle for mobile close */
  .child-sidebar .mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0; /* Increased padding */
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
  }
  
  .child-sidebar .mobile-close .handle {
    width: 60px; /* Wider handle */
    height: 5px;
    background-color: var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
  }
  
  /* Subtle feedback on handle touch */
  .child-sidebar .mobile-close:active .handle {
    transform: scaleX(0.9);
    background-color: var(--text-secondary);
  }
  
  /* Improve mobile form inputs */
  .child-sidebar input,
  .child-sidebar select,
  .child-sidebar button {
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
  }
  
  .child-sidebar button {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  }
  
  /* Add subtle fade at the bottom of the sidebar to indicate scrollable content */
  .feature-sidebar {
    position: relative;
    padding-bottom: 20px;
  }
  
  .feature-sidebar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to top, white, transparent);
    pointer-events: none;
    z-index: 1;
  }
  
  /* Hide mobile-nav border bottom */
  .mobile-nav {
    border-bottom: none;
  }
}

/* Small screen mobile adjustments */
@media (max-width: 480px) {
  /* Ensure bottom nav text is readable */
  .mobile-bottom-nav .nav-item p {
    font-size: 11px;
  }
  
  .mobile-bottom-nav .nav-item .material-icons {
    font-size: 22px;
  }
}