/* St. Paul's Hospital - Modern Medical Website Styles */
/* INSY3081 Final Project */

/* Enhanced professional medical color scheme with improved UX/UI design */
:root {
  /* Medical Blue Primary Palette - Trust & Professionalism */
  --primary-medical-blue: #1e3a8a;
  --primary-teal: #0891b2;
  --secondary-blue: #3b82f6;
  --accent-cyan: #06b6d4;

  /* Calming Medical Neutrals */
  --white: #ffffff;
  --off-white: #f8fafc;
  --light-gray: #e2e8f0;
  --medium-gray: #64748b;
  --dark-gray: #334155;
  --near-black: #0f172a;

  /* Status & Accent Colors */
  --success-green: #10b981;
  --error-red: #ef4444;
  --warning-amber: #f59e0b;
  --accent-gold: #fbbf24;

  /* Spacing System */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;

  /* Typography */
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Inter', system-ui, -apple-system, sans-serif;

  /* Light Mode Variables */
  --bg-color: #ffffff;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
  --text-color: #1e293b;
  --text-muted: #64748b;
  --card-bg: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.95);
  --footer-bg: #0f172a;
  --border-color: #e2e8f0;
  --shadow: rgba(15, 23, 42, 0.08);
  --shadow-hover: rgba(15, 23, 42, 0.16);
}

/* Dark mode with professional medical aesthetics */
[data-theme="dark"] {
  --bg-color: #0f172a;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --text-color: #f1f5f9;
  --text-muted: #94a3b8;
  --card-bg: #1e293b;
  --header-bg: rgba(15, 23, 42, 0.95);
  --footer-bg: #020617;
  --border-color: #334155;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-hover: rgba(0, 0, 0, 0.5);
  --off-white: #1e293b;
  --light-gray: #334155;
  --primary-medical-blue: #3b82f6;
  --primary-teal: #22d3ee;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5; /* More natural spacing for reading */
  color: var(--text-color);
  background: var(--bg-gradient);
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--text-color);
  margin-bottom: var(--spacing-sm);
  line-height: 1.3;
}

h1 { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.4rem; font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 600; }

p {
  margin-bottom: var(--spacing-sm);
}

a {
  color: var(--primary-medical-blue);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-teal);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Enhanced header with better backdrop blur for modern look */
/* Making header larger and bolder with increased sizing and font weights */
header {
  background-color: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  /* Increased top/bottom padding to 1rem to make header thicker */
  padding: 1rem 2.5rem; 
  transition: all 0.3s ease;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  gap: 1rem; /* Smaller gap to keep things tight */
}

/* Restructured logo section to stack vertically with text on top and logo below */
.logo-section {
  display: flex;
  align-items: center;
  margin-right: auto; /* THIS PUSHES NAV TO THE RIGHT AND LOGO TO FAR LEFT */
}

.logo-wrapper {
  display: flex;
  flex-direction: row; /* Image and text side-by-side */
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

/* Significantly increased logo for maximum visibility */
.logo-section img {
  width: 75px; /* Increased from 60px */
  height: 75px; /* Increased from 60px */
  object-fit: contain;
  flex-shrink: 0;
}

/* Text styling remains bold and prominent */
.header-title h1 {
  font-size: 1.5rem; /* Slightly adjusted for better balance */
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
  color: var(--primary-medical-blue);
  text-align: left;
}

.header-title p {
  font-size: 0.95rem; /* Slightly smaller so it doesn't compete with the title */
  font-weight: 400; /* Lighter weight for a more elegant look */
  color: var(--text-muted);
  margin: 0;
  text-align: left;
  letter-spacing: 0.3px;
}

/* Added hamburger menu button styles */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
  
  /* Matches the size of the dark mode toggle better */
  width: 40px; 
  height: 40px;
  border-radius: 50%; 
  padding: 0;
  transition: all 0.3s ease;
}

/* Added hover effect so it feels interactive but remains circular */
.menu-toggle:hover {
  background-color: rgba(30, 58, 138, 0.1); /* Very light blue circle on hover */
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--primary-medical-blue);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Navigation */
nav ul {
  list-style: none;
  display: flex;
  /* Reduced gap to 0.15rem to keep the menu compact */
  gap: 0.15rem; 
  justify-content: flex-end;
  flex-wrap: nowrap;
  margin: 0;
}

nav li {
  position: relative;
}

/* Navigation links made larger and bolder */
nav a {
  text-decoration: none;
  color: var(--text-color);
  padding: 0.6rem 1.1rem; /* Slightly wider for better pill shape */
  border-radius: 13px;    /* Changed from 13px to 50px for rounded pills */
  transition: all 0.2s ease;
  font-size: 0.92rem; 
  font-weight: 600; 
  white-space: nowrap;
  display: inline-block;
}

/* Enhanced navigation with better hover states */
nav a:hover {
  background-color: var(--primary-medical-blue);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

nav a.active {
  background-color: var(--primary-medical-blue);
  color: var(--white);
  box-shadow: 0 4px 12px var(--shadow);
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-md);
}

section {
  margin-bottom: var(--spacing-xl);
}

/* Hero Section */
.hero-section {
  position: relative;
  text-align: center;
  color: var(--white);
  margin-bottom: var(--spacing-xl);
  border-radius: 12px;
  overflow: hidden;
}

.hero-image-container {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
}

.hero-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
}

.hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
}

.hero-content h2 {
  font-size: 3rem;
  color: var(--white);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: var(--spacing-md);
}

.hero-content p {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-lg);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Enhanced button styles with medical professionalism */
.btn {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  background: linear-gradient(135deg, var(--primary-teal) 0%, var(--secondary-blue) 100%);
  color: var(--white);
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(8, 145, 178, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--primary-medical-blue) 0%, var(--secondary-blue) 100%);
}

.btn-secondary:hover {
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.4);
}

/* Card Grid Layout */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

/* Enhanced card styling with better shadows and transitions */
.card {
  background-color: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--primary-teal);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px var(--shadow-hover);
  border-top-color: var(--accent-gold);
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-content {
  padding: var(--spacing-md);
}

.card h3 {
  color: var(--primary-medical-blue);
  margin-bottom: var(--spacing-sm);
  transition: color 0.3s ease;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

/* Service Card specific styling */
.service-card ul {
  list-style: none;
  padding: 0;
  margin: var(--spacing-md) 0;
}

.service-card li {
  padding: 0.6rem 0;
  /* Changed from --dark-gray to --text-color so it is visible in both modes */
  color: var(--text-color); 
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

/* Make the checkmarks (✓) stand out slightly in a medical teal */
.service-card li::first-letter {
  color: var(--primary-teal);
  font-weight: bold;
}

.service-card li:last-child {
  border-bottom: none;
}

.service-price {
  color: var(--primary-teal);
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: var(--spacing-sm);
  display: block;
}

/* Ensure any general description text in cards is also visible */
.card-content p {
  color: var(--text-muted);
}

/* Specific Dark Mode boost for service lists */
[data-theme="dark"] .service-card li {
  color: #e2e8f0; /* Crisp light gray for dark mode readability */
}

/* Department Card specific styling */
.dept-card {
  border-top: 4px solid var(--secondary-blue);
}

.dept-card h3 {
  color: var(--primary-medical-blue);
}

.dept-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--spacing-md);
}

.feature {
  background-color: var(--off-white);
  padding: 0.5rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--primary-medical-blue);
  border: 1px solid var(--primary-teal);
  transition: all 0.3s ease;
}

/* Added hover effect for features */
.feature:hover {
  background-color: var(--primary-teal);
  color: var(--white);
  transform: scale(1.05);
}

/* Card Link styling */
.card-link {
  color: var(--primary-teal);
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-top: var(--spacing-sm);
  transition: all 0.3s ease;
}

.card-link:hover {
  color: var(--secondary-blue);
  transform: translateX(5px);
}

/* Statistics Section */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

/* Enhanced stat boxes with modern gradient */
.stat-box {
  background: linear-gradient(135deg, var(--primary-medical-blue) 0%, var(--secondary-blue) 100%);
  color: var(--white);
  padding: var(--spacing-lg);
  border-radius: 16px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  box-shadow: 0 4px 20px rgba(30, 58, 138, 0.3);
}

.stat-box:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 12px 40px rgba(30, 58, 138, 0.5);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  display: block;
  margin-bottom: var(--spacing-xs);
}

.stat-label {
  font-size: 1rem;
  opacity: 0.9;
}

/* Table Styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--spacing-md);
  background-color: var(--card-bg);
  box-shadow: 0 2px 10px var(--shadow);
  border-radius: 8px;
  overflow: hidden;
  transition: background-color 0.3s ease;
}

th,
td {
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease;
}

/* Enhanced table with better dark mode support */
th {
  background: linear-gradient(135deg, var(--primary-medical-blue) 0%, var(--secondary-blue) 100%);
  color: var(--white);
  font-weight: 600;
}

tr:hover {
  background-color: var(--off-white);
  transition: background-color 0.2s ease;
}

tr:last-child td {
  border-bottom: none;
}

/* Form Styles */
form {
  background-color: var(--card-bg);
  padding: var(--spacing-lg);
  border-radius: 12px;
  box-shadow: 0 4px 15px var(--shadow);
  transition: background-color 0.3s ease;
}

fieldset {
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  transition: border-color 0.3s ease;
}

legend {
  font-weight: 600;
  color: var(--primary-medical-blue);
  padding: 0 var(--spacing-sm);
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
  color: var(--text-color);
  transition: color 0.3s ease;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--font-body);
  transition: all 0.3s ease;
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* Enhanced focus states with medical blue */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-teal);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
  transform: translateY(-2px);
}

input.error {
  border-color: var(--error-red);
}

.error-message {
  color: var(--error-red);
  font-size: 0.875rem;
  margin-top: -var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  display: none;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

button[type="submit"],
button[type="button"],
button[type="reset"] {
  padding: var(--spacing-sm) var(--spacing-lg);
  margin-right: var(--spacing-sm);
  background: linear-gradient(135deg, var(--primary-medical-blue) 0%, var(--secondary-blue) 100%);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(30, 58, 138, 0.4);
}

button[type="reset"] {
  background: var(--medium-gray);
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

button[type="reset"]:hover {
  background-color: var(--dark-gray);
  box-shadow: 0 8px 24px rgba(100, 116, 139, 0.4);
}

/* Emergency Section */
.emergency-notice {
  background: rgba(239, 68, 68, 0.1); 
  color: var(--error-red);
  padding: 2.5rem;
  border-radius: 16px;
  text-align: center;
  margin: var(--spacing-lg) 0;
  border: 2px solid rgba(239, 68, 68, 0.2);
}

.emergency-notice h2 {
  color: var(--error-red); /* Title is now red */
  font-weight: 800;
  margin-bottom: var(--spacing-sm);
}

.emergency-hotline {
  font-size: 3rem; /* Made it larger and bolder */
  font-weight: 900;
  display: block;
  margin-top: var(--spacing-sm);
  color: var(--error-red);
  text-shadow: none; /* Clean look */
}


.doctor-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.doctor-card-item {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.doctor-card-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px var(--shadow-hover);
}

.doctor-card-item img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem;
    border: 4px solid var(--white);
    box-shadow: 0 0 0 2px var(--primary-medical-blue);
    background-color: var(--white);
}

.doctor-card-item h3 {
    font-size: 1.4rem;
    color: var(--primary-medical-blue);
    margin-bottom: 0.5rem;
}

.doctor-card-item .dept-tag {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-teal);
    text-transform: uppercase;
    display: block;
    margin-bottom: 1rem;
}

.doctor-card-item p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0.3rem 0;
}

.doctor-card-item strong { color: var(--text-color); }



.doctor-card {
  min-width: 100%; /* Forces only one doctor to show at a time */
  flex: 0 0 100%;
  padding: 3rem 2rem;
  text-align: center;
  box-sizing: border-box;
}

.doctor-card img {
  width: 240px; /* Increased size to see them better */
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.5rem;
  display: block;
  
  /* This creates a professional frame that doesn't hide the face */
  border: 4px solid var(--white); 
  box-shadow: 0 0 0 2px var(--primary-medical-blue), 0 8px 25px rgba(0,0,0,0.15);
  background-color: var(--white);
}

/* Adjust for Dark Mode so the frame looks good */
[data-theme="dark"] .doctor-card img {
  border-color: var(--card-bg);
  box-shadow: 0 0 0 2px var(--primary-teal), 0 8px 25px rgba(0,0,0,0.3);
  background-color: var(--card-bg);
}


.doctor-card h3 {
  font-size: 1.8rem;
  color: var(--primary-medical-blue);
  margin-bottom: 0.5rem;
}

.doctor-card p {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
  color: var(--text-muted);
}

.doctor-card strong {
  color: var(--text-color);
}
.doctor-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px var(--shadow);
}


/* 1. Search Box */
.doctors-search-box {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 4px 25px var(--shadow);
    text-align: center;
    margin-bottom: 4rem;
    border: 1px solid var(--border-color);
}

.badge {
    background: rgba(8, 145, 178, 0.1);
    color: var(--primary-teal);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 1.5rem; /* Space between badge and title */
}


/* --- MODERN SEARCH BAR STYLING --- */
.search-ui {
    display: flex;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
    align-items: stretch; /* Makes input and dropdown the same height */
}

.search-input-wrapper {
    flex: 2; /* Takes up more space than the dropdown */
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0 1rem;
    transition: all 0.3s ease;
}

/* The Emoji */
.search-emoji {
    font-size: 1.2rem;
    margin-right: 0.5rem;
    user-select: none; /* Prevents selecting the emoji like text */
}

/* The Input Field inside the wrapper */
.search-input-wrapper input {
    border: none !important; /* Removes the inner border */
    background: transparent !important;
    padding: 0.8rem 0;
    width: 100%;
    font-size: 1rem;
    color: var(--text-color);
    box-shadow: none !important; /* Removes inner shadow */
    margin-bottom: 0; /* Removes extra space from global input style */
}

/* Focus Effect: Glows the whole wrapper when you click inside */
.search-input-wrapper:focus-within {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.1);
    transform: translateY(-2px);
}

/* Style the Dropdown to match the search bar height and look */
.filter-select {
    flex: 1;
    margin-bottom: 0; /* Align with search bar */
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0 1rem;
    cursor: pointer;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* 2. Excellence Grid */
.excellence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 5rem 0;
}

.excellence-card {
    background: transparent;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.excellence-card:hover {
    background: var(--card-bg);
    transform: translateY(-10px);
    box-shadow: 0 10px 30px var(--shadow);
}

.excellence-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* 3. CTA Banner */
.cta-banner {
    background: linear-gradient(135deg, var(--primary-medical-blue) 0%, var(--primary-teal) 100%);
    color: white;
    padding: 4rem 2rem;
    border-radius: 24px;
    text-align: center;
    margin-top: 6rem;
}

.cta-banner h2 { color: white; font-size: 2.2rem; }
.cta-banner p { color: rgba(255, 255, 255, 0.9); margin-bottom: 2rem; }

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

/* Responsive fix */
@media (max-width: 768px) {
.search-ui { flex-direction: column; }
}

/* Mission/Vision Section */
.mission-vision {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.mission-box,
.vision-box {
  background: var(--card-bg);
  padding: var(--spacing-lg);
  border-radius: 12px;
  border-left: 4px solid var(--primary-medical-blue); /* Corrected from --primary-dark-blue */
  box-shadow: 0 2px 10px var(--shadow);
  transition: all 0.3s ease;
}

.mission-box:hover,
.vision-box:hover {
  transform: translateX(10px);
  box-shadow: 0 4px 20px var(--shadow);
}

/* Core Values */
.values-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--spacing-md);
  list-style: none;
  margin-top: var(--spacing-md);
}

.values-list li {
  background: linear-gradient(135deg, var(--primary-medical-blue) 0%, var(--secondary-blue) 100%);
  color: var(--white);
  padding: var(--spacing-md);
  text-align: center;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px var(--shadow);
}

.values-list li:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 24px var(--shadow-hover);
}

/* Contact Page - Map */
.map-container {
  margin-top: var(--spacing-md);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.map-container iframe {
  width: 100%;
  height: 400px;
  border: none;
}

/* Contact Grid Layout */
.contact-top-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr; /* Info slightly narrower than map */
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: start;
}

.contact-details-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    border: 1px solid var(--border-color);
}

.info-group {
    margin-bottom: 1.5rem;
}

.info-group h3 {
    font-size: 1.1rem;
    color: var(--primary-medical-blue);
    margin-bottom: 0.4rem;
}

.info-group p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-color);
}

/* Emergency Number Highlight */
.emergency {
    background: rgba(239, 68, 68, 0.08); /* Very light red */
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.emergency h3 { color: var(--error-red); }

.emergency-number {
    font-size: 1.8rem !important;
    font-weight: 800;
    color: var(--error-red) !important;
}

/* Map Styling */
.contact-map-wrapper iframe {
    width: 100%;
    height: 450px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px var(--shadow);
}

/* Form Styling Tweak */
/* Wider and more professional Message Section */
.contact-form-container {
    max-width: 1100px; /* Increased from 800px to make it wider */
    margin: 0 auto;
    background: var(--card-bg); /* Matches the white card look from the top */
    padding: 3rem; /* More internal space for a premium feel */
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    border: 1px solid var(--border-color);
}

.contact-form-container h3 {
    margin-bottom: 2rem;
    font-size: 1.5rem;
    color: var(--primary-medical-blue);
    text-align: center; /* Centers the heading for a better look on wide forms */
}

/* Ensures the Name and Email fields stretch nicely across the wider space */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem; /* Slightly more gap for the wider layout */
}

/* Makes the Send button a bit more prominent on the wide form */
.contact-form-container .btn {
    padding: 1rem 3rem;
    display: block;
    margin: 0 auto; /* Centers the button */
    font-size: 1.1rem;
}

/* Footer */
/* --- FOOTER FIX --- */
footer {
  background-color: var(--footer-bg);
  color: var(--white);
  padding: 2rem 1rem; 
  text-align: center;
  margin-top: var(--spacing-xl);
  transition: background-color 0.3s ease;
  border-top: 1px solid rgba(255, 255, 255, 0.1); /* Adds a subtle divider */
}

footer p {
  margin: 0.5rem 0; 
  /* Use a fixed light color so it's always readable against the dark footer */
  color: #cbd5e1 !important; 
  font-size: 0.95rem; 
  line-height: 1.6;
}

footer strong {
  color: var(--white) !important;
  font-weight: 700;
}

/* Ensure secondary text (like the copyright) is slightly dimmed but still visible */
footer p:last-child {
  color: #94a3b8 !important;
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* Specific Dark Mode boost to ensure absolute clarity */
[data-theme="dark"] footer p {
  color: #e2e8f0 !important;
}

/* Success Message */
.success-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--success-green);
  color: var(--white);
  padding: var(--spacing-xl);
  border-radius: 12px;
  display: none;
  z-index: 1002;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  min-width: 300px;
  max-width: 500px;
  text-align: center;
  cursor: pointer;
}

.success-message::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: -1;
}

.success-message.show {
  display: block;
  animation: modalFadeIn 0.5s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Added fade-in animation for page load */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Added pulse animation for important elements */
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Loading Spinner */
.loading-spinner {
  border: 4px solid var(--light-gray);
  border-top: 4px solid var(--primary-medical-blue); /* Corrected from --primary-dark-blue */
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 0.8s linear infinite;
  margin: var(--spacing-lg) auto;
  display: none;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Enhanced dark mode toggle with better positioning and style */
/* Dark mode toggle moved to header with smaller size */
/* --- THEME TOGGLE (Desktop & Global) --- */
/* --- THEME TOGGLE FIX: No spin on page load --- */
.theme-toggle {
  width: 40px; 
  height: 40px;
  background: linear-gradient(135deg, var(--primary-medical-blue) 0%, var(--primary-teal) 100%);
  color: var(--white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-left: 1rem;
  box-shadow: 0 4px 10px var(--shadow);
  
  /* Keep transition for hover, but remove rotation from the base state */
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), 
              background-color 0.3s ease;
}

/* Hover effect stays satisfying */
.theme-toggle:hover {
  transform: scale(1.15) rotate(20deg);
}

/* Tactile Click */
.theme-toggle:active {
  transform: scale(0.85);
  transition: transform 0.1s ease;
}

/* THE SPIN: When the theme changes, the whole button rotates 360 degrees */
[data-theme="dark"] .theme-toggle {
  transform: rotate(360deg);
}

/* Spin + Hover combination for Desktop */
[data-theme="dark"] .theme-toggle:hover {
  transform: scale(1.15) rotate(380deg);
}

/* Enhanced scroll to top button with better style */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-teal) 0%, var(--accent-cyan) 100%);
  color: var(--white);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(8, 145, 178, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 998;
}

.scroll-to-top.show {
  display: flex;
}

.scroll-to-top:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(8, 145, 178, 0.6);
}

/* Added smooth hover effects for all buttons */
button,
.btn {
  position: relative;
  overflow: hidden;
}

button::before,
.btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
}

/* Media queries for mobile responsive navigation with centered logo and dark mode + menu in right corner */
    
@media (max-width: 768px) {
  .header-container {
    justify-content: space-between;
    position: relative;
    padding: 0.8rem 0;
    min-height: 80px; /* Ensures header is tall enough for buttons */
  }

  .logo-section {
    order: 1;
    max-width: 60%; /* Prevents logo text from touching buttons */
  }

  .theme-toggle {
    position: absolute !important;
    right: 3.8rem;
    top: 50% !important;
    /* Base state: Centered */
    transform: translateY(-50%) !important;
    margin: 0 !important;
    z-index: 1001;
    -webkit-tap-highlight-color: transparent;
  }

  .theme-toggle:hover {
    transform: translateY(-50%) scale(1.15) rotate(20deg) !important;
  }
  
  .theme-toggle:focus  {
    transform: translateY(-50%) scale(1.1) rotate(15deg) !important;
    outline: none; /* Removes the blue box some browsers add */
  }

  /* Centered + Tactile Press */
  .theme-toggle:active {
    transform: translateY(-50%) scale(0.85) !important;
    transition: transform 0.1s ease !important;

      /* Centered + Full Spin when Dark Theme is active */
  [data-theme="dark"] .theme-toggle {
    transform: translateY(-50%) rotate(360deg) !important;
  }

    /* Centered + Spin + Hover combination */
  [data-theme="dark"] .theme-toggle:hover {
    transform: translateY(-50%) scale(1.15) rotate(380deg) !important;
  }


  }
  
  /* --- FIXED HAMBURGER --- */
  .menu-toggle {
    display: flex !important;
    position: absolute !important;
    right: 0.8rem;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 1001;
  }

  nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
    z-index: 1000;
  }

  nav.active {
    max-height: 500px;
  }

  nav ul {
    flex-direction: column;
    padding: 1.5rem;
    gap: 0.5rem;
  }

  nav a {
    display: block;
    width: 100%;
    text-align: left;
    padding: 1rem;
    border-radius: 8px; /* Slightly squarer for mobile list items */
  }

  /* Contact Page adjustments */
  .contact-top-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  header {
    padding: 1rem 1.5rem;
  }

  .logo-section img {
    width: 60px;
    height: 60px;
  }

  .header-title h1 {
    font-size: 1.2rem;
  }

  .header-title p {
    font-size: 0.75rem;
  }

  /* Adjust spacing for smaller screens */
  .theme-toggle {
    right: 0.75rem;
    top: 0.5rem;
    width: 32px;
    height: 32px;
  }

  .menu-toggle {
    right: 0.75rem;
    top: 2.75rem;
  }
}
