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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
   opacity: 0;
  animation: sectionFadeIn 1.2s 0.2s forwards;
}

/* General Responsive Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* Navigation */
.navbar {
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo .logo-link {
  display: flex;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  color: #2c5aa0;
  text-decoration: none;
  transition: color 0.2s;
}

.nav-logo .logo-link:hover {
  color: #17406e;
}

.nav-logo .logo-link i {
  margin-right: 10px;
  font-size: 28px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-link {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-link:hover {
  color: #2c5aa0;
}

.login-btn {
  background: #2c5aa0;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s;
}

.login-btn:hover {
  background: #1e3d6f;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: #333;
  margin: 3px 0;
  transition: 0.3s;
}

/* Sections */
.section {
  display: none;
  padding-top: 90px;
  min-height: 100vh;
  opacity: 0;
  transform: translateY(30px);
  animation: sectionFadeIn 1.2s 0.2s forwards;
}

.section.active {
  display: block;
  /* animation will play when .active is added */
}

@keyframes sectionFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero Section */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  gap: 40px;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero-content h1 {
  font-size: 3.5rem;
  color: #2c5aa0;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero-content p {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 30px;
}

.hero-search {
  display: flex;
  margin-bottom: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 50px;
  overflow: hidden;
}

.hero-search input {
  flex: 1;
  padding: 15px 25px;
  border: none;
  font-size: 16px;
  outline: none;
}

.hero-search button {
  background: #2c5aa0;
  color: white;
  border: none;
  padding: 15px 25px;
  cursor: pointer;
  font-size: 18px;
}

.hero-features {
  display: flex;
  gap: 30px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #666;
}

.feature i {
  color: #2c5aa0;
  font-size: 20px;
}

.hero-image {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

.hero-image .responsive-photo {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(44, 90, 160, 0.12), 0 1.5px 6px rgba(44, 90, 160, 0.07);
  transition: transform 0.5s cubic-bezier(.4, 2, .6, 1), box-shadow 0.5s;
  opacity: 0;
  transform: scale(0.95) translateY(30px);
  animation: photoFadeIn 1.2s 0.2s forwards;
}

.hero-image .responsive-photo:hover {
  transform: scale(1.03) translateY(-5px);
  box-shadow: 0 16px 48px rgba(44, 90, 160, 0.18), 0 3px 12px rgba(44, 90, 160, 0.10);
}

@keyframes photoFadeIn {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Stats */
.stats {
  display: flex;
  justify-content: center;
  gap: 80px;
  padding: 60px 20px;
  background: white;
  margin: 40px 0;
  width: 100%;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
  transition: transform 0.35s cubic-bezier(.4,2,.6,1), box-shadow 0.35s, opacity 0.7s;
  opacity: 0;
  transform: translateY(40px);
  box-shadow: none;
  will-change: transform, opacity, box-shadow;
}

.stat.visible {
  opacity: 1;
  transform: translateY(0);
}

.stat:hover {
  transform: translateY(-8px) scale(1.04);
  box-shadow: 0 8px 32px rgba(44,90,160,0.12), 0 1.5px 6px rgba(44,90,160,0.07);
  z-index: 2;
}

.stat h3 {
  font-size: 2.5rem;
  color: #2c5aa0;
  margin-bottom: 10px;
}

.stat p {
  color: #666;
  font-size: 1.1rem;
}

/* Responsive styles for stats section */
@media (max-width: 768px) {
    .stats {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        padding: 40px 10px;
    }
    .stat {
        width: 100%;
        text-align: center;
    }
    .hero-content h1 {
      font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    .container {
      padding: 0 8px;
    }
    .hero-content h1 {
      font-size: 1.5rem;
    }
    .stats {
      gap: 1rem;
      padding: 20px 2px;
    }
    .stat h3 {
      font-size: 1.2rem;
    }
    .stat p {
      font-size: 0.95rem;
    }
}

/* Search Section */
.search-container {
  max-width: 800px;
  margin: 0 auto 40px;
}

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  overflow: hidden;
  background: white;
}

.search-box input {
  flex: 1;
  padding: 15px 20px;
  border: none;
  font-size: 16px;
  outline: none;
}

.search-box button {
  background: #2c5aa0;
  color: white;
  border: none;
  padding: 15px 20px;
  cursor: pointer;
  font-size: 16px;
}

.scan-btn {
  background: #28a745 !important;
}

.filters {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.filters select {
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: white;
  cursor: pointer;
}

/* Search Results */
.search-results {
  display: grid;
  gap: 20px;
  margin-bottom: 40px;
}

.medicine-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #2c5aa0;
}

.medicine-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.medicine-name {
  font-size: 1.3rem;
  font-weight: bold;
  color: #2c5aa0;
}

.medicine-price {
  font-size: 1.2rem;
  font-weight: bold;
  color: #28a745;
}

.pharmacy-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.pharmacy-name {
  font-weight: 600;
  color: #333;
}

.distance {
  color: #666;
  font-size: 0.9rem;
}

.medicine-details {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
}

.detail {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  color: #666;
}

.status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status.available {
  background: #d4edda;
  color: #155724;
}

.status.low-stock {
  background: #fff3cd;
  color: #856404;
}

.status.out-of-stock {
  background: #f8d7da;
  color: #721c24;
}

.medicine-actions {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.btn-primary {
  background: #2c5aa0;
  color: white;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Alerts Section */
.alerts-section {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.alerts-list {
  display: grid;
  gap: 15px;
  margin-bottom: 20px;
}

.alert-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #ffc107;
}

.add-alert-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Pharmacy Dashboard */
.pharmacy-header {
  margin-bottom: 40px;
}

.pharmacy-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.stat-card {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 20px;
  border-left: 4px solid #2c5aa0;
}

.stat-card.warning {
  border-left-color: #ffc107;
}

.stat-card.success {
  border-left-color: #28a745;
}

.stat-card i {
  font-size: 2.5rem;
  color: #2c5aa0;
}

.stat-card.warning i {
  color: #ffc107;
}

.stat-card.success i {
  color: #28a745;
}

.stat-card h4 {
  margin-bottom: 5px;
  color: #333;
}

.stat-card span {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2c5aa0;
}

.pharmacy-content {
  display: grid;
  gap: 40px;
}

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

.add-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.inventory-section {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.inventory-table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background: #f8f9fa;
  font-weight: 600;
  color: #333;
}

.orders-section {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #eee;
}

/* Admin Panel */
.admin-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid #eee;
}

.tab-btn {
  background: none;
  border: none;
  padding: 15px 25px;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
}

.tab-btn.active {
  color: #2c5aa0;
  border-bottom-color: #2c5aa0;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

.pharmacies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.pharmacy-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.pharmacy-card h4 {
  color: #2c5aa0;
  margin-bottom: 10px;
}

.pharmacy-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 15px;
}

.pharmacy-status.pending {
  background: #fff3cd;
  color: #856404;
}

.pharmacy-status.approved {
  background: #d4edda;
  color: #155724;
}

.pharmacy-actions {
  display: flex;
  gap: 10px;
}

.analytics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.analytics-card {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.big-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: #2c5aa0;
  margin: 10px 0;
}

.trend {
  font-size: 0.9rem;
  font-weight: 500;
}

.trend.up {
  color: #28a745;
}

.trend.down {
  color: #dc3545;
}

.trend i {
  margin-right: 4px;
  font-size: 1em;
  vertical-align: middle;
}

.chart-container {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  height: 400px;
}

.reports-section {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.report-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.report-btn {
  background: #f8f9fa;
  border: 2px solid #2c5aa0;
  color: #2c5aa0;
  padding: 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s;
}

.report-btn:hover {
  background: #2c5aa0;
  color: white;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  position: relative;
}

.close {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #999;
}

.close:hover {
  color: #333;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #2c5aa0;
}

form button[type="submit"] {
  width: 100%;
  background: #2c5aa0;
  color: white;
  border: none;
  padding: 15px;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  margin-top: 10px;
}

/* Notifications */
.notifications {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 1500;
}

.notification {
  background: white;
  padding: 15px 20px;
  border-radius: 5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
  border-left: 4px solid #28a745;
  animation: slideIn 0.3s ease;
}

.notification.error {
  border-left-color: #dc3545;
}

.notification.warning {
  border-left-color: #ffc107;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Footer */
.footer {
  background: #333;
  color: white;
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-section h4 {
  margin-bottom: 15px;
  color: #2c5aa0;
}

.footer-section a {
  display: block;
  color: #ccc;
  text-decoration: none;
  margin-bottom: 8px;
  transition: color 0.3s;
}

.footer-section a:hover {
  color: white;
}

.footer-section a i {
  margin-right: 8px;
  color: #2c5aa0;
  vertical-align: middle;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #555;
  color: #ccc;
}

/* Responsive Design */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: center;
    gap: 30px;
    padding: 40px 10px;
  }
  .hero-content {
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.2rem;
  }
  .hero-content p {
    font-size: 1rem;
  }
  .hero-search {
    flex-direction: column;
    gap: 10px;
  }
  .hero-features {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.3rem;
  }
  .hero-content p {
    font-size: 0.95rem;
  }
  .hero-search input,
  .hero-search button {
    font-size: 1rem;
    padding: 12px;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 70px;
    right: 0;
    background: #fff;
    width: 100%;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    z-index: 1001;
  }
  .nav-menu.active {
    display: flex;
  }
  .nav-link, .login-btn {
    padding: 18px 0;
    border-bottom: 1px solid #eee;
    width: 100%;
    text-align: left;
    justify-content: flex-start;
  }
  .nav-menu {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .hero {
    flex-direction: column;
    text-align: center;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-features {
    flex-direction: column;
    gap: 15px;
  }

  .stats {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  .stat {
    width: 100%;
    text-align: center;
  }

  .stat h3 {
    font-size: 2rem;
  }

  .stat p {
    font-size: 1rem;
  }

  .search-box {
    flex-direction: column;
  }

  .filters {
    flex-direction: column;
  }

  .pharmacy-stats {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    flex-direction: column;
  }

  .analytics-cards {
    grid-template-columns: 1fr;
  }

  .modal-content {
    margin: 10% auto;
    width: 95%;
  }

  .hero-image .responsive-photo {
    max-width: 90vw;
    border-radius: 16px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .stat h3 {
    font-size: 1.5rem;
  }

  .medicine-details {
    flex-direction: column;
    gap: 10px;
  }

  .medicine-actions {
    flex-direction: column;
  }

  .pharmacy-card,
  .medicine-card {
    padding: 15px;
  }

  .hero-image .responsive-photo {
    max-width: 98vw;
    border-radius: 12px;
  }
}

@media (max-width: 600px) {
  .nav-logo .logo-link span {
    font-size: 18px;
  }
  .nav-logo .logo-link i {
    font-size: 22px;
    margin-right: 6px;
  }
  .nav-logo {
    min-width: 0;
  }
}