/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: #F8F9FA;
  color: #343A40;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.02em;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Navbar */
.navx {
  background-color: #FFFFFF;
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.1);
  border-bottom: 1px solid #CCE5FF;
  font-weight: 600;
}

.navbar {
  max-width: 1300px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  gap: 40px;
}

.logo-container {
  flex-shrink: 0;
}

.logo-container img {
  height: 52px;
  margin-left: 10px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.logo-container img:hover {
  transform: scale(1.03);
}

.nav-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-grow: 1;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  margin-top: -8px;
}

.nav-links li a {
  text-decoration: none;
  color: #343A40;
  font-weight: 600;
  font-size: 17px;
  padding: 10px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  background: transparent;
  letter-spacing: 0.03em;
}

.nav-links li a::before {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: #0D6EFD;
  transition: width 0.3s ease-in-out;
  border-radius: 4px;
}

.nav-links li a:hover::before {
  width: 80%;
}

.nav-links li a:hover {
  color: #0D6EFD;
  background-color: rgba(13, 110, 253, 0.1);
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.1);
}

/* Account Button */
.account-button.compact {
  padding: 8px 14px;
  gap: 6px;
  background: linear-gradient(to right, #ffffff, #f3faff);
  border-radius: 40px;
  box-shadow: 0 4px 14px rgba(0, 128, 202, 0.1);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  animation: fadeInUp 0.5s ease-out;
  transition: background 0.4s ease, box-shadow 0.4s ease, transform 0.3s ease;
}

.account-button.compact:hover {
  transform: translateY(-3px);
  background: linear-gradient(to right, #e0f0ff, #ffffff);
  box-shadow: 0 8px 20px rgba(0, 128, 202, 0.2);
}

.account-button .icon {
  width: 22px;
  height: 22px;
  transition: stroke 0.4s ease;
}

.account-button.compact:hover .icon {
  stroke: #1d4ed8;
}

.account-button .label {
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
  transition: color 0.4s ease;
}

.account-button.compact:hover .label {
  color: #1d4ed8;
}

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

/* Right side controls container */
.navbar-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Search Container */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 220px;
}

.search-container input[type="search"] {
  padding: 8px 36px 8px 12px;
  border-radius: 20px;
  border: 1.5px solid #0D6EFD;
  font-size: 14px;
  outline: none;
  width: 100%;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background-color: #FFFFFF;
  color: #343A40;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.search-container input[type="search"]:focus {
  border-color: #084298;
  box-shadow: 0 0 6px #CCE5FF;
}

.search-container button.search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #0D6EFD;
  user-select: none;
  transition: color 0.3s ease;
}

.search-container button.search-btn:hover {
  color: #084298;
}

.search-error {
  position: absolute;
  top: 100%;
  left: 0;
  font-size: 13px;
  color: #DC3545;
  font-weight: 600;
  min-height: 18px;
  opacity: 0;
  transition: opacity 0.3s ease;
  margin-top: 2px;
  white-space: nowrap;
}

.search-error.visible {
  opacity: 1;
}

/* Dark Mode Toggle */
.dark-mode-switch {
  display: flex;
  align-items: center;
}

.dark-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
}

.dark-mode-toggle .slider {
  position: relative;
  width: 60px;
  height: 30px;
  background-color: #eee;
  border-radius: 15px;
  transition: background-color 0.3s ease;
  overflow: hidden;
}

.dark-mode-toggle .slider::before {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  top: 2px;
  left: 2px;
  background-color: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: left 0.3s ease;
}

.dark-mode-toggle .slider i {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  font-size: 14px;
  color: #666;
  transition: left 0.3s ease, color 0.3s ease;
}

.switch-label {
  font-size: 0.9rem;
  color: #444;
  transition: color 0.4s ease;
  white-space: nowrap;
}

.dark-mode-toggle.active .slider {
  background-color: #4a4a5e;
}

.dark-mode-toggle.active .slider::before {
  left: 32px;
}

.dark-mode-toggle.active .slider i {
  left: 38px;
  color: #ffd700;
}

/* Menu Toggle Button */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #0D6EFD;
  user-select: none;
  padding: 4px 8px;
  transition: color 0.3s ease;
}

.menu-toggle:hover {
  color: #084298;
}

/* Side Menu (Mobile Only) */
.side-menu {
  position: fixed;
  top: 70px;
  right: -100%;
  width: 260px;
  background-color: #f9f9f9;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
  padding: 20px;
  transition: right 0.4s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  border-radius: 0 0 12px 12px;
}

.side-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-menu ul li {
  margin: 15px 0;
}

.side-menu ul li a {
  display: block;
  padding: 10px 15px;
  color: #0D6EFD;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.side-menu ul li a:hover,
.side-menu ul li a:focus {
  background-color: #e7f0ff;
  color: #0a58ca;
  box-shadow: inset 0 0 5px rgba(13, 110, 253, 0.2);
  outline: none;
}

.side-menu.active {
  right: 0;
  display: flex;
}

/* Layout */
.container {
  background: linear-gradient(to bottom right, #ffffff, #f0f4f8);
  max-width: 1100px;
  margin: 4rem auto;
  padding: 2.5rem;
  border-radius: 1.25rem;
  box-shadow: 0 8px 30px rgba(0, 128, 202, 0.12);
  transition: all 0.3s ease-in-out;
}

/* Header */
.header {
  display: grid;
  margin-bottom: 20px;
  grid-template-columns: 140px auto;
  align-items: center;
  gap: 24px;
  background: #ffffff;
  padding: 24px;
  margin-left: 10px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 128, 202, 0.1);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.header:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 128, 202, 0.15), 0 2px 8px rgba(0, 128, 202, 0.05);
}

.header img {
  width: 155px;
  height: 145px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #0080ca;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.header img:hover {
  transform: scale(1.1);
  filter: brightness(1.1);
}

.header h1 {
  font-size: 2.6rem;
  font-weight: 700;
  color: #0080ca;
  margin-bottom: 8px;
  margin-left: 20px;
}

.header h3 {
  font-size: 1.15rem;
  font-weight: bold;
  color: #6b7c93;
  margin-left: 20px;
  font-weight: 500;
}

/* Sections */
section {
  margin-bottom: 24px;
}

section h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #0080ca;
  position: relative;
  margin-left: 23px;
  margin-bottom: 16px;
  padding-bottom: 8px;
}

.About {
  margin-left: -8px !important;
}

.Qual {
  margin-left: -8px !important;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 5px;
  background: #0D6EFD;
  border-radius: 10px;
}

/* Grid Cards */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.card {
  background: #ffffff;
  padding: 24px;
  border-radius: 10px;
  margin-left: 10px;
  box-shadow: 0 4px 20px rgba(0, 128, 202, 0.08);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 128, 202, 0.12);
}

/* Lists */
ul {
  list-style: none;
}

ul li {
  margin-bottom: 8px;
  padding-left: 1.6em;
  position: relative;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

th,
td {
  padding: 8px 16px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #0D6EFD;
  color: #fff;
  font-weight: 600;
}

tr:nth-child(even) {
  background: #f9fbfd;
}

/* Blockquotes */
blockquote {
  border-left: 6px solid #0D6EFD;
  background: #ffffff;
  padding: 16px;
  border-radius: 10px;
  font-weight: bold;
  margin: 24px 0;
  font-style: italic;
  color: #6b7c93;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  padding: 8px 24px;
  border-radius: 10px;
  font-weight: 600;
  transition: background 0.4s ease, transform 0.4s ease;
  margin-top: 8px;
}

.button i {
  margin-right: 8px;
}

.btn-primary {
  background: #0D6EFD;
  color: #fff;
}

.btn-primary:hover {
  background: #084298;
  color: #fff;
  transform: translateY(-2px);
}

.btn-accent {
  background: #0080ca;
  color: #fff;
}

.btn-accent:hover {
  background: #1d4ed8;
  color: #fff;
  transform: translateY(-2px);
}

/* Social Icons */
.social-links a {
  margin-right: 16px;
  color: #6b7c93;
  font-size: 1.3rem;
  transition: color 0.4s ease, transform 0.4s ease;
}

.social-links a:hover {
  color: #0080ca;
  transform: translateY(-2px);
}

/* Utility */
.icon {
  margin-right: 8px;
  color: #0D6EFD;
}

.text-center {
  text-align: center;
}

/* Links */
a {
  color: #0080ca;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #1d4ed8;
}

strong {
  color: #0080ca;
}

/* Footer */
.footer {
  background-color: #152a3f;
  color: #FFFFFF;
  padding: 40px 0;
  font-size: 15px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 0 !important;
}

.footer-container {
  max-width: 1200px;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
}

.footer-column {
  flex: 1 1 250px;
}

.footer-column h3 {
  margin-bottom: 15px;
  color: #FFFFFF;
  font-size: 18px;
  border-bottom: 2px solid #0D6EFD;
  display: inline-block;
  padding-bottom: 5px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.footer-column a {
  color: #CCE5FF;
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
}

.footer-column a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.social a {
  display: inline-block;
  margin-top: 10px;
  margin-right: 10px;
  color: #66B2FF;
}

/* Dark Mode Styles */
body.dark-mode {
  background-color: #1e1e2f;
  color: #e0e0e0;
}

body.dark-mode .container {
  background: none !important;
  background-color: rgb(42, 42, 61) !important;
}

body.dark-mode .switch-label {
  color: #e0e0e0;
}

body.dark-mode .navx {
  background-color: #2c2c3c;
  border-bottom: 1px solid #444;
}

body.dark-mode .nav-links li a {
  color: #fff;
}

body.dark-mode .nav-links li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

body.dark-mode .search-container input[type="search"] {
  background-color: #3a3a4a;
  color: #fff;
  border: 1px solid #666;
}

body.dark-mode .search-container .search-btn {
  color: #fff;
}

body.dark-mode .side-menu {
  background-color: #2c2c3c;
  box-shadow: -4px 0 12px rgba(255, 255, 255, 0.05);
}

body.dark-mode .side-menu ul li a {
  color: #ffffff;
}

body.dark-mode .side-menu ul li a:hover,
body.dark-mode .side-menu ul li a:focus {
  background-color: rgba(255, 255, 255, 0.1);
  color: #90c6ff;
}

body.dark-mode .header {
  background-color: #1f1f2e !important;
  color: #ffffff !important;
}

body.dark-mode .header h1 {
  color: #0080ca !important;
}

body.dark-mode .header h3 {
  color: #ccc !important;
}

body.dark-mode .card {
  background-color: #1f1f2e !important;
  color: #ffffff !important;
  border-color: #333 !important;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

body.dark-mode section h2 {
  color: #0080ca !important;
}

body.dark-mode blockquote {
  background-color: #1f1f2e !important;
  color: #ccc !important;
  border-left: 6px solid #0D6EFD !important;
}

body.dark-mode th {
  background: #0D6EFD !important;
}

body.dark-mode tr:nth-child(even) {
  background: #2a2a3d !important;
}

body.dark-mode .footer {
  background-color: #222233;
  color: #ccc;
}

body.dark-mode .footer a {
  color: #aaa;
}

body.dark-mode .footer a:hover {
  color: #fff;
}

/* Loading Screen */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  background-color: #f8f9fa;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

body.dark-mode .loading {
  background-color: #2C2C3C;
}

.loading.fade-out {
  opacity: 0;
  visibility: hidden;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.heart svg {
  width: 120px;
  height: 120px;
}

.pulse {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: pulseMove 1.5s ease-in-out infinite;
}

@keyframes pulseMove {
  0% {
    stroke-dashoffset: 60;
  }
  50% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 60;
  }
}

.loading h1 {
  font-family: Arial, sans-serif;
  font-size: 2rem;
  margin-top: 10px;
}

.white {
  color: #000;
}

body.dark-mode .white {
  color: #fff;
}

.blue {
  color: #007bff;
}

/* Responsive */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none !important;
  }

  .navbar-controls {
    gap: 10px;
  }

  .search-container {
    width: 180px;
  }

  .switch-label {
    display: none;
  }

  .container {
    margin: 100px 40px 100px 40px;
    padding: 25px;
  }

  .header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .header img {
    margin: 0 auto;
  }

  section h2 {
    font-size: 1.4rem;
  }

  .footer {
    padding: 20px 0;
  }

  #f1 {
    gap: 0px;
    margin-top: 150px;
    margin-bottom: -140px;
  }

  #f2 {
    gap: 0px;
    margin-bottom: -130px;
  }

  #f3 {
    margin-bottom: 50px;
  }

  .footer-column h3 {
    margin-bottom: 8px;
    font-size: 16px;
  }

  .footer-column p,
  .footer-column a {
    margin-bottom: 6px;
    font-size: 14px;
  }

  .social a {
    margin-right: 6px;
    font-size: 14px;
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .header h1 {
    font-size: 1.5rem;
  }
  
  section {
    padding: 15px 20px;
  }
  
  #appointments thead {
    display: none;
  }
  
  #appointments tbody td {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 10px;
  }
  
  #appointments tbody tr {
    margin-bottom: 15px;
    display: block;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
  }
  
  #appointments tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
    color: #1e3a8a;
  }
}

@media (min-width: 769px) {
  .side-menu {
    display: flex !important;
  }
}