/* --- GLOBAL THEME & VARIABLES --- */
:root {
  --primary: #0077cc;
  --primary-hover: #005fa3;
  --primary-focus: rgba(0, 119, 204, 0.125);
  --primary-inverse: #fff;
  --background-body: #f8f9fa;
  --card-bg: #ffffff;
  --nav-bg: #ffffff;
  --text-main: #333;
  --border-radius: 8px;
  --spacing-company: 3rem;
}

body {
  font-family: 'Lato', sans-serif;
  background-color: var(--background-body);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, hgroup h2, h4 {
  font-family: 'Merriweather', serif;
  color: var(--primary);
}

/* --- NAVIGATION --- */
nav {
  background-color: var(--nav-bg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.5rem 0;
}

nav ul li strong {
  font-size: 1.25rem;
  color: var(--primary);
}

/* --- HERO SECTIONS --- */
.hero {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  padding: 4rem 0;
  margin-bottom: 3rem;
  border-bottom: 1px solid #e1e4e8;
}

.hero-small {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  padding: 3rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid #e1e4e8;
  text-align: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

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

.hero-image img {
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  object-fit: cover;
  height: 400px;
  width: 100%;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* --- CARDS & LAYOUTS --- */
.content-card, .table-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
  border: 1px solid #eaeaea;
}

/* Services Card with Hover Effect */
.service-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  border: 1px solid #eaeaea;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.grid.two-col {
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* --- MEDIA (IMAGES & VIDEO) --- */
.media-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.3s ease;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  margin-bottom: 0.5rem;
}

.media-wrapper img, 
.media-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
}

.media-wrapper:hover {
  transform: translateY(-5px);
}

figcaption {
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: #666;
  text-align: center;
  border-top: 2px solid var(--primary);
  background: #fafafa;
}

/* --- BUTTONS --- */
.cta-button {
  background-color: var(--primary);
  border: none;
  padding: 12px 24px;
  font-weight: bold;
  transition: background 0.3s;
}

.cta-button:hover {
  background-color: var(--primary-hover);
}

/* --- FORMS & INPUTS --- */
input, select, textarea {
  color: #333 !important;
  background-color: #fff !important;
}

/* --- PHONE INPUT GROUP (Updated Width) --- */
.phone-group {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.phone-group select {
  flex: 0 0 140px; /* Increased to 140px for visibility */
  width: 140px;    /* Increased to 140px */
  margin-bottom: 0 !important;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.phone-group input {
  flex: 1;
  margin-bottom: 0 !important;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* Success Message */
#successMessage {
  text-align: center;
  padding: 2rem;
  display: none;
}
#successMessage h2 { color: #28a745; margin-bottom: 1rem; }
#successMessage p { font-size: 1.2rem; color: #555; }

/* --- MODAL STYLING --- */
dialog {
  width: 100%;
  max-width: 500px;
  border-radius: var(--border-radius);
  border: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  padding: 0;
  background: white;
  z-index: 2000;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

dialog article {
  margin: 0;
  max-width: 100%;
}

dialog header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e1e4e8;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

dialog header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--primary);
}

dialog .close {
  cursor: pointer;
  font-size: 1.5rem;
  color: #666;
  text-decoration: none;
}

dialog footer {
  background-color: #f8f9fa;
  border-top: 1px solid #e1e4e8;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

#reviewContent {
  padding: 1.5rem;
}

#reviewContent table {
  margin: 0;
  width: 100%;
}

#reviewContent th {
  text-align: left;
  color: #666;
  width: 40%;
  padding: 0.5rem 0;
}

#reviewContent td {
  text-align: right;
  font-weight: bold;
  color: #333;
  padding: 0.5rem 0;
}

/* --- DEPARTMENTS PAGE --- */
.dept-header {
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}
.doctor-list {
  background-color: #f8fbff;
  padding: 1rem;
  border-radius: 6px;
  border-left: 4px solid var(--primary);
  margin-top: 1rem;
}

/* --- CHATBOT PAGE --- */
.chat-wrapper {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  border: 1px solid #eaeaea;
  max-width: 800px;
  margin: 2rem auto;
}
.chat-container {
  background: #f0f7fb;
  padding: 1rem;
  border-radius: 10px;
  height: 400px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  border: 1px solid #dae1e7;
}
.chat-message {
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  max-width: 75%;
  clear: both;
  font-size: 0.95rem;
  line-height: 1.5;
  position: relative;
}
.chat-message.user {
  background: var(--primary);
  color: white;
  float: right;
  text-align: right;
  border-bottom-right-radius: 2px;
}
.chat-message.bot {
  background: #e9ecef;
  color: #333;
  float: left;
  border-bottom-left-radius: 2px;
}

/* --- ADMIN DASHBOARD --- */
.admin-body nav {
  background-color: #2c3e50;
  color: white;
}
.admin-body nav ul li strong, .admin-body nav ul li a {
  color: white !important;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.stat-box {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  text-align: center;
  border: 1px solid #eaeaea;
}
.stat-box h4 { margin-bottom: 0.5rem; font-size: 1rem; color: #666; }
.stat-box p { font-size: 2.5rem; font-weight: bold; color: var(--primary); margin: 0; }

/* --- FOOTER & SOCIAL MEDIA --- */
footer {
  background-color: #2c3e50;
  color: white;
  padding: 3rem 0 2rem; 
  text-align: center;
  margin-top: auto;
}
footer a { color: #bdc3c7; text-decoration: none; transition: color 0.2s; }
footer a:hover { color: white; }

/* Social Icons - Strictly 3 per row */
.social-links {
  display: grid;
  grid-template-columns: repeat(3, max-content); 
  gap: 1rem;
  margin-top: 1rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.1);
  color: white;
  font-size: 1.25rem;
  transition: all 0.3s ease;
}

.social-links a:hover {
  background-color: var(--primary);
  transform: translateY(-3px);
  color: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .hero-grid, .grid.two-col { grid-template-columns: 1fr; }
  .hero-image { order: -1; margin-bottom: 1rem; }
  
  footer .grid { 
      grid-template-columns: 1fr !important; 
      gap: 2rem; 
      text-align: center !important;
  }
  
  /* Center the grid on mobile */
  .social-links {
      justify-content: center;
      margin: 1rem auto;
  }
}
/* =========================================
   MEDICAL CAMPS GALLERY GRID
   ========================================= */

/* 1. Grid Layout: 3 per row on desktop */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); 
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* Tablet Layout: 2 per row */
@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Layout: 1 per row */
@media (max-width: 576px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* 2. Gallery Item Box */
.gallery-item {
  border-radius: var(--border-radius, 8px);
  overflow: hidden; /* Keeps the zoomed image inside the box */
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  aspect-ratio: 4 / 3; /* Ensures all images are the exact same height/shape */
  background: #000;
}

/* 3. The Image (Starts slightly zoomed IN) */
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.15); /* 15% zoomed in by default */
  transition: transform 0.4s ease-out; /* Smooth transition */
}

/* 4. The Hover Effect (Zooms OUT on mouse-over) */
.gallery-item:hover img {
  transform: scale(1); /* Zooms out to 100% normal size */
}