html, body {
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background: #f9f9f9;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  padding: 1rem;
  flex: 1;
}

/* === HEADER === */
header {
  background: #333;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  flex-wrap: nowrap;
  min-height: 64px;
  transition: padding 0.3s ease, box-shadow 0.3s ease;
}

header.shrink {
  padding: 0.3rem 2rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

header h1 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #ffffff;
  cursor: default;
  transition: font-size 0.3s ease;
}

.brand-name-link {
  text-decoration: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

header.shrink h1 {
  font-size: 1.5rem;
}

.logo-container {
  display: flex;
  align-items: center;
  margin-right: 1rem;
  transition: height 0.3s ease;
}

.logo-container img {
  height: 40px;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: height 0.3s ease;
}

header.shrink .logo-container img {
  height: 28px;
}

/* === Navbar === */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #333;
  padding: 1rem 2rem;
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: #ffd54f;
}

/* === Intro Section === */
.intro-section {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin: 1rem 0 1.5rem;
  padding: 1.2rem 1.5rem;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease-out 0.1s forwards;
}

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

.intro-image img {
  max-width: 340px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s ease;
}

.intro-image img:hover {
  transform: scale(1.05);
}

.intro-info {
  max-width: 480px;
  text-align: left;
}

.intro-info h2 {
  font-size: 2.1rem;
  font-weight: 900;
  color: #222;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 0.6rem;
}

.nmc-link a {
  font-size: 1.1rem;
  color: #0077cc;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.nmc-link a:hover {
  text-decoration: underline;
  color: #005fa3;
}

.about-text {
  font-size: 1.1rem;
  text-align: justify;
  text-indent: 1.2rem;
  color: #444;
  margin-bottom: 0rem !important;
  line-height: 1.50;
}

.about-text a {
  color: #0077cc;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

.about-text a:hover {
  color: #005fa3;
}

/* Navigation underlined hover effect */
nav {
  display: flex;
  gap: 2.5rem;
}

nav a {
  position: relative;
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.2rem 0;
  transition: color 0.3s ease;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: white;
  transition: width 0.3s ease;
}

nav a:hover {
  color: #ffd54f;
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

nav a.active {
  color: #ffd54f;
}

/* Article Section */
.articles-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.articles-header h2 {
  font-size: 1.5rem;
  flex: 1;
  margin: 0;
}

.search-bar input {
  padding: 0.6rem 0.9rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 280px;
  max-width: 100%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Bottom Section */
.bottom-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  background-color: #f8f8f8;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  flex-wrap: wrap;
  min-height: 200px;
}

.column {
  flex: 1;
  min-width: 240px;
}

.emergency-contact h3 {
  margin-top: 0;
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
}

.emergency-contact p {
  margin: 0.4rem 0;
  font-size: 1rem;
}

.emergency-contact a {
  color: #0077cc;
  text-decoration: none;
}

.emergency-contact a:hover {
  text-decoration: underline;
}

/* Doctor badge & social icons */
.center-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin: 1rem 0;
}

.center-badge img {
  height: 50px;
  transition: transform 0.3s ease;
  margin-bottom: 1rem;
}

.center-badge img:hover {
  transform: scale(1.05);
}

.social-icons {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  align-items: center;
}

.social-icons a {
  font-size: 1.5rem;
  color: #333;
  transition: color 0.3s ease, transform 0.3s ease;
}

.social-icons a:hover {
  color: #0077cc;
  transform: scale(1.2);
}

.social-icons a.instagram    { color: #E1306C; }
.social-icons a.tiktok       { color: #010101; }
.social-icons a.threads      { color: #000000; }
.social-icons a.youtube      { color: #FF0000; }
.social-icons a.facebook     { color: #1877F2; }
.social-icons a.snapchat     { color: #810505; }
.social-icons a.twitter      { color: #000000; }
.social-icons a.google       { color: #d42626; }

/* Doctor photo */
.doctor-photo {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.doctor-photo img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  background-color: transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Footer */
footer {
  background: #333;
  color: white;
  text-align: center;
  padding: 1rem 0;
  font-weight: 600;
  font-size: 0.95rem;
}

footer a {
  color: #ffd54f;
  text-decoration: none;
  font-weight: 600;
}

footer a:hover {
  text-decoration: none;
  color: #fff;
}

/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  transition: transform 0.2s;
}

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

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.card-title {
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: bold;
}

/* Form Styles */
form {
  max-width: 600px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input, textarea {
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  transition: border-color 0.3s ease;
}

input:focus, textarea:focus {
  border-color: #0077cc;
  outline: none;
}

button {
  padding: 0.75rem;
  background: #333;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

button:hover {
  background: #555;
}

@media (max-width: 768px) {
  .brand {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.6rem;
  }

  .nav-links {
    position: fixed;          /* fix to viewport */
    top: 0;
    right: -100%;             /* hidden offscreen right */
    width: 240px;
    height: 100vh;            /* full height */
    background: #444;
    flex-direction: column;
    padding: 4rem 1.5rem 1rem; /* top padding to clear hamburger */
    gap: 1rem;
    z-index: 1099;
    display: flex;
    transition: right 0.3s ease-in-out;
  }

  .nav-links.open {
    right: 0;                 /* slide in */
  }

  .nav-links a {
    padding: 0.9rem 1rem;
    font-size: 1.1rem;
    border-bottom: 1px solid #555;
    color: white;
    text-decoration: none;
  }

  .nav-links a:hover {
    color: #ffd54f;
  }

  .navbar-brand {
    font-size: 1.3rem;
  }

  .logo-container img {
    height: 32px;
  }

  .bottom-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .doctor-photo {
    justify-content: center;
  }

  .doctor-photo img {
    width: 140px;
    height: 140px;
  }

  .brand h1 {
    font-size: 1.2rem;
    white-space: nowrap;
  }

  .brand {
    flex-wrap: nowrap;
  }

  header {
    padding-right: 3.5rem;
  }
}

@media (max-width: 480px) {
  .brand {
    flex-direction: row;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
  }

  .brand h1 {
    font-size: 1rem;
    white-space: nowrap;
  }
}

#scrollToTopBtn {
  position: fixed;
  bottom: 30px;
  right: 40px;
  display: none; /* Hidden by default */
  background-color: #007bff; /* Bootstrap blue or pick your color */
  color: white;
  border: none;
  border-radius: 70%;
  padding: 10px 14px;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  transition: opacity 0.3s ease;
  z-index: 1000;
}

#scrollToTopBtn:hover {
  background-color: #0056b3;
}

.menu-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  padding: 0.25rem;
  display: none;
  align-items: center;
  justify-content: center;
}

.menu-toggle:hover i {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    background-color: #333;
    border-radius: 6px;
  }
}