:root {
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #0f172a;
  --accent: #2a9d8f;
  --background: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 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);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', 'Hind Siliguri', sans-serif;
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.5;
}

/* Navigation */
.navbar {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: #f1f5f9;
}

/* Hero Section */
.hero {
  position: relative;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  padding: 6rem 2rem 10rem;
  text-align: center;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 32px 32px;
}

.hero-container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.hero p {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto 1.5rem;
  opacity: 0.9;
}

.chat-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(42, 157, 143, 0.15);
  padding: 0.6rem 1.25rem;
  border-radius: 1rem;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  animation: float 3s ease-in-out infinite;
}

.chat-cta i {
  color: #fbbf24;
  font-size: 1.25rem;
}

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

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  backdrop-filter: blur(4px);
}

/* Search Section */
.search-section-wrapper {
  margin-top: -5rem;
  position: relative;
  z-index: 2;
  padding: 0 2rem;
}

.search-section {
  background: var(--card-bg);
  padding: 2.5rem;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.search-box-container {
  margin-bottom: 2rem;
}

.search-box {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border: 2px solid transparent;
  padding: 0.5rem 0.5rem 0.5rem 1.5rem;
  border-radius: 1rem;
  transition: var(--transition);
}

.search-box:focus-within {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.search-icon {
  color: var(--text-muted);
  font-size: 1.25rem;
}

#searchInput {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  font-size: 1.125rem;
  color: var(--text-main);
  outline: none;
}

.search-buttons {
  display: flex;
  gap: 0.5rem;
}

.search-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.search-btn:hover {
  background: var(--primary-dark, #4338ca);
  transform: translateY(-1px);
}

.clear-btn {
  background: #e2e8f0;
  color: var(--text-main);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.clear-btn:hover {
  background: #cbd5e1;
}

/* Filters */
.filter-section {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.filter-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border);
  background: white;
  color: var(--text-muted);
  border-radius: 2rem;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.4);
}

/* Results Grid */
.results-section {
  padding: 4rem 2rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.medicine-card {
  background: white;
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

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

.card-header {
  padding: 1.5rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #eef2ff;
  color: var(--primary);
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.info-label {
  color: var(--text-muted);
}

.info-value {
  font-weight: 600;
  color: var(--text-main);
}

.price-tag {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: #f0fdf4;
  color: #166534;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 0.875rem;
  display: inline-block;
}

/* Footer */
.footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  text-align: center;
}

/* Utilities & Animations */
.loading {
  text-align: center;
  padding: 4rem;
  color: var(--primary);
}

/* Initial Message & Popular Searches */
.initial-message {
  text-align: center;
  padding: 5rem 2rem;
  background: white;
  border-radius: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-top: 2rem;
}

.initial-message i {
  color: var(--primary);
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 6px rgba(79, 70, 229, 0.2));
}

.initial-message h3 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.initial-message p {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-bottom: 2.5rem;
}

.popular-searches {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.popular-searches small {
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.5rem;
}

.popular-btn {
  padding: 0.4rem 1rem;
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 2rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.popular-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Chat Widget */
.chat-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
}

.chat-button {
  width: 60px;
  height: 60px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.chat-button:hover {
  transform: scale(1.1);
  background: #4338ca;
}

.chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  max-width: calc(100vw - 4rem);
  height: 450px;
  background: white;
  border-radius: 1.25rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.chat-window.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.chat-header {
  background: var(--primary);
  color: white;
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h4 {
  font-weight: 700;
  font-size: 1rem;
}

.chat-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 0.3rem 0.6rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
}

.chat-messages {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #f8fafc;
}

.msg {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

.msg-user {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 0.25rem;
}

.msg-admin {
  align-self: flex-start;
  background: white;
  color: var(--text-main);
  border-bottom-left-radius: 0.25rem;
  border: 1px solid var(--border);
}

.chat-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
}

.chat-footer input {
  flex: 1;
  border: 1px solid var(--border);
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  outline: none;
  font-size: 0.875rem;
}

.chat-footer input:focus {
  border-color: var(--primary);
}

.chat-footer button {
  background: var(--primary);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.chat-footer button:hover {
  background: #4338ca;
}


/* Pagination */
.pagination-container {
  margin-top: 3rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}

.pagination-btn {
  padding: 0.6rem 1.25rem;
  background: white;
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: #f8fafc;
  transform: translateY(-2px);
}

.pagination-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f1f5f9;
}

.pagination-dots {
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* No Results State */
.no-results {
  text-align: center;
  padding: 5rem 2rem;
  background: white;
  border-radius: 2rem;
  border: 1px dashed var(--border);
  grid-column: 1 / -1;
  animation: fadeIn 0.5s ease-out;
}

.no-results i {
  font-size: 4rem;
  color: #e2e8f0;
  margin-bottom: 2rem;
  display: block;
}

.no-results h3 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.no-results p {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 500px;
  margin: 0 auto;
}

.no-results-query {
  color: var(--primary);
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  background: #eef2ff;
  border-radius: 0.25rem;
}

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

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.25rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .search-section {
    padding: 1.5rem;
  }
  
  .search-box {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }
  
  #searchInput {
    width: 100%;
    padding: 0;
    font-size: 1rem;
  }
  
  .search-buttons {
    width: 100%;
    gap: 0.5rem;
  }
  
  .search-btn {
    flex: 1;
    justify-content: center;
    padding: 0.75rem;
  }
  
  .clear-btn {
    width: 44px;
    height: 44px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 4rem 1rem 8rem;
  }
  
  .hero-stats {
    gap: 0.75rem;
  }
  
  .stat-item {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
  
  .filter-btns {
    justify-content: center;
  }
  
  .filter-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
}
