
/* ========== Global Reset ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  color: #222;
  background: #f9fafc;
  line-height: 1.6;
}

/* ========== Navbar ========== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0077b6;
  color: white;
  padding: 15px 7%;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  flex-wrap: wrap;
}

.logo-section {
  display: flex;
  align-items: center;
}

.logo-section img {
  height: 45px;
  margin-right: 10px;
}

.logo-section h1 {
  font-size: 22px;
}

.logo-section span {
  color: #90e0ef;
}

nav {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.2);
}

nav a.active {
  border-bottom: 2px solid #fff;
  padding-bottom: 3px;
}

/* ========== Hero Section ========== */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 60px 10%;
  background: linear-gradient(120deg, #caf0f8, #ffffff);
  flex-wrap: wrap;
}

.hero-content {
  width: 50%;
  min-width: 300px;
}

.hero-content h2 {
  font-size: 32px;
  color: #023e8a;
}

.hero-content p {
  margin: 20px 0;
  font-size: 17px;
  color: #333;
}

.btn-primary {
  background: #0077b6;
  color: white;
  padding: 12px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
}

.btn-primary:hover {
  background: #023e8a;
}

.hero-image img {
  width: 380px;
  max-width: 100%;
}

/* ========== Search Section ========== */
.search-section {
  text-align: center;
  padding: 40px 10px;
  background: #eaf6ff;
}

#searchInput {
  width: 60%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #bbb;
}

.search-results {
  width: 60%;
  margin: 15px auto;
  text-align: left;
}

/* ========== Categories Section ========== */
.categories {
  text-align: center;
  padding: 50px 10px;
}

.categories h2 {
  color: #023e8a;
  margin-bottom: 20px;
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.category {
  background: #90e0ef;
  color: #023e8a;
  border-radius: 20px;
  padding: 12px 25px;
  display: flex;
  align-items: center;
  font-weight: 600;
}

.category img {
  width: 25px;
  margin-right: 8px;
}

/* ========== Medicine Cards ========== */
.medicine-list {
  text-align: center;
  padding: 60px 10px;
}

.medicine-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.medicine-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 12px;
  margin: 15px;
  padding: 20px;
  width: 250px;
  text-align: left;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s;
}

.medicine-card:hover {
  transform: translateY(-5px);
}

.medicine-card h3 {
  color: #0077b6;
}

.medicine-card a {
  color: #0077b6;
  font-weight: 600;
  text-decoration: none;
}

/* ========== Donate Section ========== */
.donate {
  background: #caf0f8;
  text-align: center;
  padding: 60px 20px;
}

.donate-box {
  background: white;
  display: inline-block;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  max-width: 400px;
}

#payBtn {
  padding: 12px 30px;
  background: #0077b6;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  margin-top: 10px;
  cursor: pointer;
}

#payBtn:hover {
  background: #023e8a;
}

/* ========== Footer ========== */
footer {
  background: #023e8a;
  color: white;
  padding: 40px 10%;
}

.footer-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.footer-col {
  flex: 1;
  margin: 10px;
}

.footer-col h3 {
  margin-bottom: 10px;
}

.footer-col a {
  display: block;
  color: white;
  text-decoration: none;
  margin: 4px 0;
}

.footer-col a:hover {
  text-decoration: underline;
}

/* ========== QR Modal ========== */
.qr-modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
}

.qr-content {
  background: white;
  padding: 30px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  max-width: 320px;
  width: 90%;
  position: relative;
  animation: popIn 0.3s ease;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 26px;
  color: #333;
  cursor: pointer;
  font-weight: bold;
}

@keyframes popIn {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ========== Loading Spinner ========== */
.loading-spinner {
  border: 6px solid #eee;
  border-top: 6px solid #0077b6;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  margin: 40px auto;
  animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ========== Responsive Design ========== */
@media (max-width: 900px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px;
  }

  nav {
    flex-wrap: wrap;
    gap: 10px;
  }

  nav a {
    font-size: 15px;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    padding: 40px 5%;
  }

  .hero-content {
    width: 100%;
  }

  .hero-content h2 {
    font-size: 26px;
  }

  .hero-content p {
    font-size: 15px;
  }

  .hero-image img {
    width: 80%;
    max-width: 300px;
    margin-top: 15px;
  }

  #searchInput {
    width: 90%;
  }

  .category {
    width: 45%;
    justify-content: center;
  }

  .medicine-card {
    width: 90%;
    margin: 10px auto;
  }

  .donate-box {
    width: 90%;
    padding: 20px;
  }

  #payBtn {
    width: 100%;
  }

  footer {
    padding: 30px 5%;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
  }

  .footer-col {
    margin: 15px 0;
  }
}

@media (max-width: 480px) {
  .hero-content h2 {
    font-size: 22px;
    line-height: 1.3;
  }

  .btn-primary {
    padding: 10px 20px;
    font-size: 15px;
  }

  .category p {
    font-size: 14px;
  }

  .donate h2 {
    font-size: 20px;
  }
}
