/**
 * Halaman / modal Cari Dokter — selaras rs.kemkes.go.id
 */

/* Sembunyikan modal lama dari body halaman (node) jika masih ada duplikat. */
#doctorProfileModal:not(:has(.rsst-doctor-detail__layout)) {
  display: none !important;
}

:root {
  --rsst-primary: #007d6a;
  --rsst-primary-hover: #00a793;
  --rsst-primary-light: #e6f2f0;
  --rsst-text: #1a1a1a;
  --rsst-text-muted: #767676;
  --rsst-border: #e8e8e8;
  --rsst-section-border: #f2f2f2;
}

.rsst-doctor-modal-dialog {
  max-width: 1140px;
}

.rsst-doctor-modal-content {
  border-radius: 16px;
  overflow: hidden;
}

.rsst-doctor-detail__layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .rsst-doctor-detail__layout {
    flex-direction: row;
    gap: 2rem;
    align-items: flex-start;
  }
}

/* Sidebar */
.rsst-doctor-sidebar {
  width: 100%;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .rsst-doctor-sidebar {
    width: 347px;
    position: sticky;
    top: 1rem;
    align-self: flex-start;
  }
}

.rsst-doctor-sidebar__card {
  background: #fff;
  border: 1px solid var(--rsst-border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

@media (min-width: 768px) {
  .rsst-doctor-sidebar__card {
    padding: 20px;
  }
}

.rsst-doctor-sidebar__photo-wrap {
  background: var(--rsst-primary-light);
  border-radius: 13px;
  overflow: hidden;
  aspect-ratio: 1;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .rsst-doctor-sidebar__photo-wrap {
    height: 300px;
    aspect-ratio: auto;
  }
}

.rsst-doctor-sidebar__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rsst-doctor-sidebar__name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--rsst-text);
  line-height: 1.3;
  margin: 0 0 0.25rem;
}

@media (min-width: 768px) {
  .rsst-doctor-sidebar__name {
    font-size: 1.125rem;
  }
}

.rsst-doctor-sidebar__specialty {
  font-size: 0.75rem;
  color: var(--rsst-text);
  margin: 0 0 0.5rem;
}

@media (min-width: 768px) {
  .rsst-doctor-sidebar__specialty {
    font-size: 0.875rem;
  }
}

.rsst-doctor-sidebar__location {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
  font-size: 0.625rem;
  line-height: 1.4;
  color: var(--rsst-text-muted);
  margin: 0 0 1rem;
}

@media (min-width: 768px) {
  .rsst-doctor-sidebar__location {
    font-size: 0.75rem;
  }
}

.rsst-doctor-icon {
  color: var(--rsst-primary);
  font-size: 0.875rem;
  line-height: 1;
  flex-shrink: 0;
}

.rsst-doctor-icon--btn {
  font-size: 1rem;
}

.rsst-doctor-sidebar__location .rsst-doctor-icon {
  margin-top: 2px;
}

.rsst-doctor-sidebar__actions {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.rsst-doctor-sidebar__janji {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  background-color: var(--rsst-primary);
  color: #fff;
  border: none;
}

@media (min-width: 768px) {
  .rsst-doctor-sidebar__janji {
    min-height: 51px;
    font-size: 1rem;
    gap: 0.875rem;
    padding: 12px 14px;
  }
}

.rsst-doctor-sidebar__janji:hover {
  background-color: var(--rsst-primary-hover);
  color: #fff;
}

.rsst-doctor-sidebar__share {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 16px;
  border: 1px solid var(--rsst-primary);
  color: var(--rsst-primary);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .rsst-doctor-sidebar__share {
    width: 51px;
    height: 51px;
    min-width: 51px;
  }
}

.rsst-doctor-sidebar__share:hover {
  background: var(--rsst-primary-light);
  color: var(--rsst-primary);
}

/* Main content */
.rsst-doctor-main {
  flex: 1;
  min-width: 0;
}

.rsst-doctor-tabs {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--rsst-border);
  margin-bottom: 0;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
}

.rsst-doctor-tabs__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: none;
  background: transparent;
  padding: 0.625rem 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--rsst-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}

.rsst-doctor-tabs__btn .bi {
  font-size: 1rem;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .rsst-doctor-tabs__btn .bi {
    display: none;
  }
}

.rsst-doctor-tabs__btn.is-active {
  color: var(--rsst-primary);
  border-bottom-color: var(--rsst-primary);
}

.rsst-doctor-tabs__btn:hover {
  color: var(--rsst-primary);
}

/* Override base.css `section { padding: 100px 0 }` di dalam modal */
#doctorProfileModal section.rsst-doctor-section,
#doctorProfileModal #profile,
#doctorProfileModal #education,
#doctorProfileModal #schedule {
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  margin-left: 0;
  margin-right: 0;
}

#doctorProfileModal .rsst-doctor-section {
  margin-top: 1.25rem;
  padding-bottom: 1.25rem !important;
  border-bottom: 1px solid var(--rsst-section-border);
  scroll-margin-top: 3.5rem;
}

#doctorProfileModal .rsst-doctor-section:first-of-type {
  margin-top: 0.875rem;
}

#doctorProfileModal .rsst-doctor-section:last-child {
  border-bottom: none;
  padding-bottom: 0 !important;
  margin-bottom: 0;
}

#doctorProfileModal .rsst-doctor-section__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--rsst-text);
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

#doctorProfileModal .rsst-doctor-section__title .bi {
  color: var(--rsst-primary);
  font-size: 1.125rem;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  #doctorProfileModal .rsst-doctor-section__title {
    font-size: 1.125rem;
  }
}

#doctorProfileModal .rsst-doctor-section__subtitle {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rsst-text);
  margin: 0 0 0.625rem;
}

#doctorProfileModal .rsst-doctor-section__body {
  margin: 0;
}

#doctorProfileModal .rsst-doctor-profile-text {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--rsst-text);
  margin: 0;
}

/* Education timeline */
#doctorProfileModal .rsst-edu-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  margin: 0;
  padding: 0;
}

.rsst-edu-timeline__line {
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: #e0e0e0;
}

#doctorProfileModal .rsst-edu-item {
  position: relative;
  display: flex;
  gap: 0.75rem;
  padding-left: 1.5rem;
}

.rsst-edu-item__dot {
  position: absolute;
  left: 0;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--rsst-primary);
}

.rsst-edu-item__major {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rsst-text);
  line-height: 1.4;
  margin: 0;
}

.rsst-edu-item__meta {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--rsst-text-muted);
  margin: 0.25rem 0 0;
}

.rsst-edu-item__year {
  font-weight: 600;
  color: #333;
}

.rsst-edu-item__school {
  color: rgba(51, 51, 51, 0.7);
}

/* Schedule */
#doctorProfileModal .rsst-schedule-card {
  border: 1px solid var(--rsst-border);
  border-radius: 12px;
  background: #fff;
  padding: 0.75rem 1rem;
  overflow: hidden;
  margin: 0;
}

.rsst-schedule-card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rsst-text);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(26, 26, 26, 0.1);
}

.rsst-schedule-card__header .bi {
  color: var(--rsst-primary);
  font-size: 1rem;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .rsst-schedule-card__header {
    font-size: 1rem;
    padding-bottom: 0.875rem;
    margin-bottom: 0.875rem;
  }
}

.rsst-schedule-card__header a {
  color: inherit;
  text-decoration: none;
}

.rsst-schedule-card__header a:hover {
  color: var(--rsst-primary);
}

.rsst-schedule-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

@media (min-width: 992px) {
  .rsst-schedule-grid {
    flex-direction: row;
    gap: 0.5rem;
  }
}

.rsst-schedule-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rsst-schedule-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

@media (min-width: 576px) {
  .rsst-schedule-row {
    gap: 1rem;
  }
}

.rsst-schedule-row__day {
  width: 100px;
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--rsst-text);
  line-height: 1.4;
}

.rsst-schedule-row__time {
  flex: 1;
  font-size: 0.875rem;
  color: var(--rsst-text-muted);
  line-height: 1.4;
}

#doctorProfileModal .rsst-doctor-loading {
  text-align: left;
  padding: 0.25rem 0;
}

.rsst-doctor-empty {
  color: var(--rsst-text-muted);
  font-size: 0.875rem;
  margin: 0;
}

/* Legacy modal classes from node body (backward compat) */
.modal-doctor-sidebar,
.nav-tabs-kemenkes,
.timeline-edu {
  /* superseded by rsst-doctor-* classes */
}

.btn-janji-konsultasi {
  background-color: var(--rsst-primary);
  color: #fff;
  font-weight: 600;
  border-radius: 16px;
  border: none;
}

.btn-janji-konsultasi:hover {
  background-color: var(--rsst-primary-hover);
  color: #fff;
}
