:root {
  /* Brand Colors */
  --primary: #2563eb; /* Royal Blue */
  --primary-dark: #1e40af;
  --primary-light: #dbeafe;
  --secondary: #64748b; /* Slate for secondary text */
  --accent: #0ea5e9; /* Sky blue for accents */
  
  /* Backgrounds */
  --bg-body: #f8fafc; /* Very light slate/gray */
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  
  /* Text */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #ffffff;
  
  /* Borders */
  --border-color: #e2e8f0;
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-blue: 0 4px 14px 0 rgba(37, 99, 235, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  margin: 0;
  display: flex;
  min-height: 100vh;
}

/* Layout */
.app-container {
  display: flex;
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 10;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 40px;
  letter-spacing: -0.5px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 12px;
  margin-bottom: 8px;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-item:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

.nav-item.active {
  background-color: var(--primary);
  color: var(--text-light);
  box-shadow: var(--shadow-blue);
}

.nav-icon {
  width: 20px;
  height: 20px;
  margin-right: 12px;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px; /* Offset for fixed sidebar */
  padding: var(--spacing-xl);
}

/* Top Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.search-bar {
  display: flex;
  background: white;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  width: 500px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.search-input {
  border: none;
  outline: none;
  width: 100%;
  padding: 8px;
  font-size: 14px;
  color: var(--text-main);
}

.search-icon {
  margin-right: 8px;
  color: #94a3b8;
}

.search-divider {
  height: 24px;
  width: 1px;
  background: #e2e8f0;
  margin: 0 12px;
}

.location-text {
  color: var(--text-muted);
  font-size: 14px;
  white-space: nowrap;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-weight: 600;
}

/* Sort & Filter Section (The Focus) */
.results-header {
  margin-bottom: 32px;
}

.results-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.results-subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

.sort-panel {
  background: white;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

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

.sort-label {
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-options-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.sort-pill {
  padding: 10px 20px;
  border-radius: 100px;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sort-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.sort-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-blue);
}

.helper-text {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Doctor Cards */
.doctors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.doctor-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.doctor-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.doctor-header {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.doctor-img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background-color: var(--primary-light);
  flex-shrink: 0;
}

.doctor-info h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 600;
}

.specialty {
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  display: block;
}

.experience {
  color: var(--text-muted);
  font-size: 12px;
}

.stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.stat-icon {
  width: 16px;
  height: 16px;
  color: var(--secondary);
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price {
  font-weight: 700;
  font-size: 18px;
  color: var(--text-main);
}

.price span {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.btn-book {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-book:hover {
  background: var(--primary-dark);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.badge-green {
  background: #dcfce7;
  color: #166534;
}

/* Utilities */
.flex-spacer {
  flex: 1;
}

.text-sm {
  font-size: 14px;
}

/* Dashboard Specific Styles */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 32px;
}

/* Banner */
.banner {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  border-radius: 24px;
  padding: 40px;
  color: white;
  position: relative;
  overflow: hidden;
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.banner-content {
  position: relative;
  z-index: 2;
  max-width: 60%;
}

.banner h2 {
  font-size: 32px;
  margin: 0 0 16px 0;
  line-height: 1.3;
}

.banner p {
  font-size: 16px;
  opacity: 0.9;
  margin: 0 0 24px 0;
}

.online-doctors {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 100px;
  width: fit-content;
  backdrop-filter: blur(10px);
}

.avatar-group {
  display: flex;
}

.avatar-group .avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #1e3a8a;
  margin-left: -10px;
  background-color: #ddd;
  background-size: cover;
}

.avatar-group .avatar-mini:first-child {
  margin-left: 0;
}

.banner-image {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 110%;
  width: auto;
  object-fit: contain;
  z-index: 1;
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.view-all {
  color: var(--primary); /* Use primary color, likely green or blue from screenshot. Screenshot shows Green text "View All" */
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Nearby Doctors Horizontal List */
.nearby-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.mini-doctor-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: all 0.2s;
}

.mini-doctor-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.mini-doctor-img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background-size: cover;
  flex-shrink: 0;
}

.mini-doctor-info h4 {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 600;
}

.mini-doctor-info p {
  margin: 0 0 8px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.distance-tag {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Appointment Widget (Right Side) */
.appointment-widget {
  background: white;
  border-radius: 20px;
  padding: 0; /* Let children handle padding if needed, but screenshot implies just a list in the column */
}

/* Actually, the screenshot shows the "Upcoming Appointments" title is outside, and the list is below. */
/* The "Upcoming Appointments" list is a vertical stack of cards or items */

.month-selector {
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-weight: 600;
  font-size: 14px;
}

.appointment-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.appointment-card {
  background: #fff0f1; /* Light red/pink bg from screenshot */
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: transform 0.2s;
}

.appointment-card:hover {
  transform: scale(1.02);
}

.appointment-card.variant-blue {
  background: #f0f9ff; /* Light blue variant if needed */
}

.appointment-card.variant-gray {
  background: white;
  border: 1px solid var(--border-color);
}

.date-badge {
  background: rgba(255,255,255,0.6);
  border-radius: 12px;
  width: 50px;
  height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.date-day {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 2px;
}

.date-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.appt-info h4 {
  margin: 0 0 4px 0;
  font-size: 15px;
  font-weight: 600;
}

.appt-info p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.arrow-btn {
  margin-left: auto;
  color: var(--text-muted);
}

/* Recommended Grid (Bottom) */
.recommended-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* Media Query for Dashboard */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .nearby-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  /* Layout reset */
  .app-container {
    flex-direction: column;
  }

  .main-content {
    margin-left: 0;
    padding: var(--spacing-md);
    padding-bottom: 90px; /* Space for bottom nav */
  }

  /* Sidebar -> Bottom Navigation */
  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    bottom: 0;
    left: 0;
    top: auto;
    flex-direction: row;
    justify-content: space-around;
    padding: 12px 8px;
    border-right: none;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    z-index: 1000;
  }

  .logo {
    display: none;
  }

  .sidebar .nav-item {
    flex-direction: column;
    margin-bottom: 0;
    padding: 8px 4px;
    font-size: 10px;
    text-align: center;
    gap: 4px;
    border-radius: 8px;
    flex: 1;
    justify-content: center;
  }

  .sidebar .nav-icon {
    margin-right: 0;
    width: 24px;
    height: 24px;
  }

  .sidebar .flex-spacer {
    display: none;
  }

  /* Header adjustments */
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
  }

  .top-header > div:first-child {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    order: 1; /* Keep welcome text first */
  }

  .user-profile {
    /* Use fixed position or just small icon? Let's stack it */
    /* Wait, the design has user profile on right. In mobile, maybe keep it there on the top row */
  }

  /* Search bar */
  .search-bar {
    width: 100%;
    order: 2; /* Move below welcome text */
  }

  /* Banner adjustments */
  .banner {
    flex-direction: column;
    text-align: center;
    padding: 24px;
    min-height: auto;
  }

  .banner-content {
    max-width: 100%;
    margin-bottom: 20px;
  }

  .banner h2 {
    font-size: 22px;
  }

  .online-doctors {
    margin: 0 auto; /* Center it */
  }

  .banner-illustration {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    height: 180px;
    background-position: center bottom !important;
    margin-top: 10px;
  }

  /* Grid adjustments */
  .dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  .nearby-grid, .doctors-grid {
    grid-template-columns: 1fr; /* Full width cards on mobile */
    gap: 16px;
  }

  .sort-panel {
    padding: 16px;
  }

  .mini-doctor-card {
    padding: 12px;
  }
  
  .recommended-grid {
    grid-template-columns: 1fr;
  }

  /* Adjust recommended card internals */
  .stats-row {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .stat-item {
    font-size: 12px;
  }

  /* Appointment Widget */
  .appointment-widget {
    margin-bottom: 20px;
  }
  
  .appointment-card {
    padding: 12px;
  }
  
  .date-badge {
    width: 40px;
    height: 50px;
  }
  
  .date-num {
    font-size: 16px;
  }
}
