/* === SEARCH BAR LAYOUT === */
.search-container {
  display: flex;
  /* margin: 0 3rem; */
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  /* padding-left: 3rem; */
}
.search-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-color);
}
.search-title span {
  color: var(--primary-color);
}

.search-form {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

/* === SEARCH BAR STYLING === */
.search-bar {
  display: flex;
  width: 100%;
  max-width: 620px;
  height: 46px;
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.search-bar input {
  flex: 1;
  border: none;
  padding: 0 1.5rem;
  font-size: 1rem;
  color: var(--text-color);
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar button {
  width: 120px;
  border: none;
  background: var(--primary-color);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
}

.search-bar button:hover {
  background: var(--hover-color);
}

/* === Doctor Item as Card === */
.doctor-item {
  background: var(--background-color);
  border-radius: 0.75rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 2.5rem;
}
.doctor-item .photo {
  flex: 0 0 250px;
  overflow: hidden;
}
.doctor-item .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
}
.doctor-item .info {
  flex: 1;
}
.doctor-item .info h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: var(--text-color);
}
.doctor-item .info .specialty {
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.doctor-item .info table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.doctor-item .info th,
.doctor-item .info td {
  border: 1px solid var(--background-muted);
  padding: 0.5rem;
  text-align: center;
  color: var(--text-color);
}
.doctor-item .info th {
  background: var(--background-muted);
}

/* === View Detail Hover === */
.btn-view-detail {
  transition: background-color 0.3s, transform 0.2s;
}
.btn-view-detail:hover {
  background-color: var(--hover-color);
  transform: translateY(-2px);
}

/* Hilangkan tombol Reservasi Online */
.actions .btn-primary {
  display: none;
}

/* === FILTER TABS CARD === */

.filter-tabs {
  max-width: auto;
  margin: 0 auto 2rem;
  background: var(--background-color);
  border-radius: 0.75rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  gap: 2rem;
}

.filter-tabs .tab {
  background: transparent;
  border: none;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.25rem 0.75rem;
}

.filter-tabs .tab-all {
  background: var(--secondary-color);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}

.filter-tabs .tab:hover {
  color: var(--hover-color);
}

.filter-tabs .show-more {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.filter-tabs .arrow-down {
  margin-left: 0.25rem;
  transition: transform 0.2s;
}

.filter-tabs .show-more:hover .arrow-down {
  transform: rotate(180deg);
}

/* === Atur Lebar Main Container Halaman Dokter === */
main.container.py-5 {
  max-width: 1100px;    /* ganti 900px sesuai kebutuhan */
  width: 100%;         /* pastikan responsive */
  margin: 0 auto;      /* center secara horizontal */
  padding-left: 1rem;  /* optional: beri ruang sisi */
  padding-right: 1rem; /* optional: beri ruang sisi */
}

/* === Styling THEAD pada tabel jadwal dokter === */

.doctor-item .info table thead th {
  background-color: var(--primary-color);
  color: #fff;          /* teks putih agar kontras */
  font-weight: 600;        /* optional: tebal sedikit */
  text-transform: uppercase; /* optional: huruf besar semua */
  padding: 0.15rem;        /* ruang lebih lega */
}

/* === WIDTH FIXED UNTUK KOLom JADWAL DOKTER === */
.doctor-item .info table {
  width: 100%;
  table-layout: fixed; /* pakai fixed layout untuk mendistribusikan lebar sama rata */
}

.doctor-item .info table th,
.doctor-item .info table td {
  width: calc(100% / 7); /* 7 kolom → masing-masing ~14.2857% */
  text-align: center;
  overflow: hidden;      /* mencegah isi kelebihan lebar */
  white-space: nowrap;   /* mencegah wrap */
}


/* === VIEW DETAIL BUTTON GRADIENT === */
.btn-view-detail {
  display: inline-block;
  background: linear-gradient(
    90deg,
    var(--secondary-color) 0%,
    var(--primary-color) 100%
  );
  /* agar gradient bisa digeser */
  background-size: 200% 100%;
  background-position: 100% 0;
  
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  
  /* tambahkan background-position ke transition */
  transition: background-position 0.4s ease,
              transform 0.2s,
              box-shadow 0.2s;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.btn-view-detail:hover {
  /* geser gradient sehingga warna primary (kanan) pindah ke kiri */
  background-position: 0 0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* === FILTER TABS HOVER EFFECT === */
.filter-tabs .tab {
  transition: background-color 0.3s, color 0.3s;
}

.filter-tabs .tab:not(.tab-all):hover,
.filter-tabs .tab:not(.active):hover {
  background-color: var(--secondary-color);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
}


/* — Fix hover flash di filter-tabs — */
.filter-tabs .tab {
  /* Bentuk radius & padding selalu dipertahankan */
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  padding: 0.25rem 0.75rem;
  
  /* Warna teks default */
  color: var(--primary-color);
  font-weight: 600;
  
  /* Transisi halus */
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Hover untuk semua tab (kecuali active) */
.filter-tabs .tab:hover:not(.active) {
  background-color: var(--secondary-color);
  color: #fff;
}

/* Styling untuk tab yang sedang aktif */
.filter-tabs .tab.active {
  background-color: var(--secondary-color);
  color: #fff;
}
/* ============================= */
/* RESPONSIVE SELURUH TAMPILAN   */
/* ============================= */

/* Tablet ke bawah (≤992px): card jadi satu kolom, foto di atas */
@media (max-width: 992px) {
  .doctor-list {
    grid-template-columns: 1fr;
  }
  .doctor-item {
    flex-direction: column;
    text-align: center;
  }
  .doctor-item .photo {
    width: 100%;
    height: auto;
    margin-bottom: 1rem;
  }
  .doctor-item .info {
    padding: 1rem;
  }
}

/* Mobile landscape & tablet kecil (≤768px): search & title tumpuk, filter scrollable */
@media (max-width: 768px) {
  .search-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .search-form {
    width: 100%;
  }
  .search-bar {
    max-width: 100%;
  }
  .filter-tabs {
    overflow-x: auto;
    white-space: nowrap;
    gap: 1rem;
  }
  .filter-tabs .tab {
    flex: 0 0 auto;
  }
}

/* Mobile portrait (≤576px): tabel jadwal scroll horizontal */
@media (max-width: 576px) {
  .doctor-item .info table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .doctor-item .info table thead,
  .doctor-item .info table tbody {
    display: table;
    width: 100%;
    table-layout: fixed;
  }
  /* Kecilkan padding & font pada tombol */
  .btn-view-detail {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
}

/* Container tombol Show More */
.load-more-container {
  text-align: center;
  margin: 2rem 0;
}

/* Tombol Show More */
.btn-show-more {
  background-color: #00A99D;
  border: 1px solid #00A99D;
  color: #fff;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-show-more:hover {
  background-color: #159d8c;
}

.btn-show-more:active {
  transform: scale(0.98);
}

.btn-show-more:disabled,
.btn-show-more[disabled] {
  background-color: var(--background-muted);
  border-color: var(--background-muted);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes zoomOut {
  from { opacity: 0; transform: scale(1.2);}
  to   { opacity: 1; transform: scale(1);}
}
@keyframes flipInY {
  from { opacity: 0; transform: perspective(400px) rotateY(60deg);}
  to   { opacity: 1; transform: perspective(400px) rotateY(0);}
}
@keyframes flipInX {
  from { opacity: 0; transform: perspective(400px) rotateX(60deg);}
  to   { opacity: 1; transform: perspective(400px) rotateX(0);}
}
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(.3);}
  50%  { opacity: 1; transform: scale(1.05);}
  70%  { transform: scale(.9);}
  100% { transform: scale(1);}
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-80px);}
  to   { opacity: 1; transform: none;}
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(80px);}
  to   { opacity: 1; transform: none;}
}
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(80px);}
  to   { opacity: 1; transform: none;}
}
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-80px);}
  to   { opacity: 1; transform: none;}
}
@keyframes blurIn {
  from { opacity:0; filter: blur(10px);}
  to   { opacity:1; filter: blur(0);}
}
@keyframes rotateIn {
  from { opacity: 0; transform: rotate(-360deg) scale(0.7);}
  to   { opacity: 1; transform: none;}
}

/* Default: hide dulu */
.animate-fadein,
.animate-fadeout,
.animate-zoomin,
.animate-zoomout,
.animate-flipiny,
.animate-flipinx,
.animate-bouncein,
.animate-slideinleft,
.animate-slideinright,
.animate-slideinup,
.animate-slideindown,
.animate-blurin,
.animate-rotatein
{
  opacity: 0;
}

.animate-fadein.active      { animation: fadeIn 1.2s both; opacity: 1;}
.animate-fadeout.active     { animation: fadeOut 1.2s both;}
.animate-zoomin.active      { animation: zoomIn 1.3s both; opacity: 1;}
.animate-zoomout.active     { animation: zoomOut 1.3s both; opacity: 1;}
.animate-flipiny.active     { animation: flipInY 1.3s both; opacity: 1;}
.animate-flipinx.active     { animation: flipInX 1.3s both; opacity: 1;}
.animate-bouncein.active    { animation: bounceIn 1.4s both; opacity: 1;}
.animate-slideinleft.active { animation: slideInLeft 1.2s both; opacity: 1;}
.animate-slideinright.active{ animation: slideInRight 1.2s both; opacity: 1;}
.animate-slideinup.active   { animation: slideInUp 1.2s both; opacity: 1;}
.animate-slideindown.active { animation: slideInDown 1.2s both; opacity: 1;}
.animate-blurin.active      { animation: blurIn 1.1s both; opacity: 1;}
.animate-rotatein.active    { animation: rotateIn 1.3s both; opacity: 1;}

/* Tablet ke bawah (≤992px): search + title tumpuk, card dokter 1 kolom */
@media (max-width: 992px) {
  /* Search Bar */
  .search-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  .search-title {
    font-size: 1.5rem;
  }
  .search-form {
    width: 100%;
    justify-content: flex-start;
  }
  .search-bar {
    max-width: 100%;
  }

  /* Doctor Item */
  .doctor-item {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }
  .doctor-item .photo {
    width: 100%;
    margin-bottom: 1rem;
  }
  .doctor-item .info {
    width: 100%;
  }
}

/* Smartphone besar (≤768px): filter-tabs scrollable + tombol search full */
@media (max-width: 768px) {
  /* Filter Tabs */
  .filter-tabs {
    overflow-x: auto;
    white-space: nowrap;
    padding: 0.5rem;
    gap: 1rem;
  }
  .filter-tabs .tab,
  .filter-tabs .tab-all {
    flex: 0 0 auto;
  }

  /* Search Bar */
  .search-bar {
    height: 40px;
  }
  .search-bar button {
    width: 100px;
    font-size: 0.9rem;
  }

  /* Doctor Schedule Table */
  .doctor-item .info table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Smartphone kecil (≤576px): font dan padding lebih ringkas */
@media (max-width: 576px) {
  .search-title {
    font-size: 1.25rem;
  }
  .search-bar input {
    padding: 0 1rem;
    font-size: 0.9rem;
  }
  .search-bar button {
    font-size: 0.85rem;
    padding: 0 0.75rem;
  }

  .doctor-item .info h3 {
    font-size: 1rem;
  }
  .doctor-item .info table th,
  .doctor-item .info table td {
    padding: 0.25rem;
    font-size: 0.75rem;
  }
  .btn-view-detail {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }
}
/* === TABLE RESPONSIVE WRAPPER === */
.table-responsive {
  width: 100%;
  overflow-x: auto;               /* izinkan geser horizontal */
  -webkit-overflow-scrolling: touch; /* smooth scrolling di iOS */
}

/* MEDIA QUERY: ≤768px (sesuaikan breakpoint) */
@media (max-width: 768px) {
  /* Terapkan wrapper pada .info jika belum pakai class */
  .doctor-item .info {
    padding-bottom: 1rem;         /* ruang bawah agar scrollbar tidak menimpa konten */
  }
  .doctor-item .info table {
    min-width: 700px;             /* total lebar minimal tabel (7 kolom × ~100px) */
    width: auto;                  /* biarkan sesuai isi */
    table-layout: fixed;          /* kolom rata */
  }
}
