/* ==========================================================================
   AFYA KWANZA HOSPITAL - MAIN STYLESHEET (RESPONSIVE)
   ========================================================================== */

/* 1. VARIABILI ZA RANGI */
:root {
  --primary-color: #0b6fa4;       /* Bluu kuu */
  --primary-dark: #08547e;        /* Bluu iliyokolea */
  --secondary-color: #0ea5a4;     /* Green/Teal ya afya */
  --light-bg: #f4f7f6;            /* Background ya ukurasa */
  --card-bg: #ffffff;             /* Background ya kadi */
  --text-color: #2c3e50;          /* Rangi ya maandishi */
  --text-muted: #6c757d;          /* Rangi ya maandishi madogo */
  --border-color: #e2e8f0;        /* Mipaka ya kadi na table */
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* Kivuli cha kadi */
  --radius: 8px;                  /* Mviringo wa pembeni */
  --transition: all 0.3s ease;
}

/* 2. RESET NA BASIC STYLES */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: var(--light-bg);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

main {
  flex: 1;
  max-width: 1100px;
  width: 90%;
  margin: 20px auto;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* 3. HEADER & LOGO */
header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #ffffff;
  padding: 25px 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  text-align: center;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 1100px;
  margin: 0 auto;
}

header img, 
.header-content img {
  width: 95px;
  height: 95px;
  object-fit: contain;
  border-radius: 50%;
  background: #ffffff;
  padding: 5px;
  border: 3px solid #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  margin-bottom: 5px;
}

.header-text h1 {
  font-size: 2rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-text p {
  margin: 3px 0 0 0;
  font-size: 1rem;
  opacity: 0.95;
}

/* 4. NAVIGATION BAR */
nav {
  background-color: var(--primary-dark);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

nav a {
  color: #ffffff;
  text-decoration: none;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}

nav a:hover,
nav a.active {
  background-color: var(--secondary-color);
  color: #ffffff;
}

/* 5. SECTIONS & CARDS */
.section {
  background-color: var(--card-bg);
  padding: 25px 30px;
  margin-bottom: 25px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.section h2 {
  color: var(--primary-color);
  font-size: 1.5rem;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--secondary-color);
  display: inline-block;
}

.section h3 {
  color: var(--primary-dark);
  margin: 20px 0 10px 0;
  font-size: 1.2rem;
}

/* 6. GRIDS */
.services-grid,
.cards-grid,
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.service-card,
.card,
.news-item {
  background-color: var(--card-bg);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.service-card:hover,
.card:hover,
.news-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-color: var(--secondary-color);
}

.service-card h3,
.card h3,
.news-item h3 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 10px;
}

.doctor-card {
  text-align: center;
  align-items: center;
}

.doctor-card img {
  border-radius: 50%;
  margin-bottom: 15px;
  background: var(--light-bg);
  padding: 8px;
}

.doctor-card .specialty {
  font-weight: bold;
  color: var(--secondary-color);
  margin-bottom: 10px;
}

.news-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: block;
}

/* 7. GALLERY STYLES */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.gallery-item {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  text-align: center;
}

.gallery-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.gallery-item p {
  padding: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
}

/* 8. BANNER */
.hospital-banner {
  width: 100%;
  margin-top: 15px;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hospital-banner img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

/* 9. BUTTONS */
.btn-whatsapp,
.btn-appointment,
.btn-submit {
  display: inline-block;
  background-color: var(--secondary-color);
  color: #ffffff;
  padding: 10px 18px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 600;
  margin-top: auto;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-whatsapp {
  background-color: #25d366;
}

.btn-whatsapp:hover {
  background-color: #1eb954;
}

.btn-appointment:hover,
.btn-submit:hover {
  background-color: var(--primary-color);
}

/* 10. LISTS */
ul, ol {
  margin-left: 20px;
  margin-bottom: 15px;
}

li {
  margin-bottom: 8px;
}

.upcoming-list {
  list-style: none;
  margin-left: 0;
}

.upcoming-list li {
  background: var(--light-bg);
  padding: 10px 15px;
  margin-bottom: 8px;
  border-radius: 5px;
  border-left: 4px solid var(--secondary-color);
}

/* 11. TABLES */
.table-responsive {
  overflow-x: auto;
  margin-top: 15px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 15px;
  background-color: var(--card-bg);
}

th, td {
  padding: 12px 15px;
  text-align: left;
  border: 1px solid var(--border-color);
}

th {
  background-color: var(--primary-color);
  color: #ffffff;
  font-weight: 600;
}

tr:nth-child(even) {
  background-color: var(--light-bg);
}

/* 12. BLOCKQUOTES & NOTES */
blockquote, .emergency-note {
  background-color: #fff3cd;
  border-left: 5px solid #ffc107;
  padding: 15px;
  margin: 15px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #856404;
}

/* 13. FORM STYLES */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 600px;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-weight: 600;
}

.form-group input,
.form-group textarea {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 1rem;
  width: 100%;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 5px rgba(11, 111, 164, 0.3);
}

/* 14. FOOTER */
footer {
  background-color: var(--primary-dark);
  color: #ffffff;
  text-align: center;
  padding: 20px 15px;
  margin-top: auto;
  font-size: 0.9rem;
}

/* ==========================================================================
   15. RESPONSIVE DESIGN (SPECIAL FOR MOBILE PHONES)
   ========================================================================== */
@media screen and (max-width: 768px) {
  main {
    width: 95%;
    margin: 15px auto;
  }

  header {
    padding: 15px 10px;
  }

  header img, 
  .header-content img {
    width: 75px;
    height: 75px;
  }

  .header-text h1 {
    font-size: 1.4rem;
  }

  .header-text p {
    font-size: 0.9rem;
  }

  nav {
    flex-direction: column;
    position: relative; /* Inapunguza matatizo ya sticky header kwenye simu ndogo */
  }

  nav a {
    text-align: center;
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
  }

  .section {
    padding: 15px;
    margin-bottom: 15px;
  }

  .section h2 {
    font-size: 1.25rem;
  }

  .services-grid,
  .cards-grid,
  .news-grid,
  .gallery-grid {
    grid-template-columns: 1fr; /* Inatengeneza kadi zikae moja baada ya nyingine */
    gap: 15px;
  }

  .gallery-item img {
    height: 200px; /* Ongezeko kidogo la urefu wa picha kwenye simu */
  }

  th, td {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
}
/* ==========================================================================
   15. RESPONSIVE DESIGN (SPECIAL FOR MOBILE PHONES) - HORIZONTAL LAYOUT
   ========================================================================== */
@media screen and (max-width: 768px) {
  main {
    width: 95%;
    margin: 15px auto;
  }

  header {
    padding: 15px 10px;
  }

  header img, 
  .header-content img {
    width: 75px;
    height: 75px;
  }

  .header-text h1 {
    font-size: 1.4rem;
  }

  .header-text p {
    font-size: 0.9rem;
  }

  nav {
    flex-direction: row; /* Inafanya menu za navigation zikae kwa mlalo kwenye simu */
    justify-content: center;
    position: sticky;
  }

  nav a {
    padding: 10px 12px;
    font-size: 0.85rem;
    border-bottom: none;
    width: auto;
  }

  .section {
    padding: 15px;
    margin-bottom: 15px;
  }

  .section h2 {
    font-size: 1.25rem;
  }

  /* KUBADILISHA GRID ZIKAE KWA MLALO (HORIZONTAL SCROLL AU 2 COLUMNS) */
  .services-grid,
  .cards-grid,
  .news-grid,
  .gallery-grid {
    display: flex;
    overflow-x: auto; /* Inaruhusu kadi kuteleza kwa mlalo (horizontal scroll) */
    gap: 15px;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
  }

  .service-card,
  .card,
  .news-item,
  .gallery-item {
    min-width: 260px; /* Inaweka ukubwa maalum wa kadi ili zikae kwa mlalo */
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .gallery-item img {
    height: 160px;
  }

  th, td {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
}