/* Orayol sidebar (Gemini-style history) + profile dropdown.
   Layered on top of orayol-chat.css; relies on existing theme tokens. */

.orayol-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.orayol-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--color--theme-color-01, #e2f2fc);
  border-right: 1px solid rgba(10, 10, 10, 0.06);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, width 0.25s ease;
  position: relative;
  z-index: 30;
  overflow: hidden;
}

.orayol-sidebar.is-collapsed {
  width: 0;
  min-width: 0;
  transform: translateX(-100%);
  border-right: 0;
  pointer-events: none;
}

.orayol-sidebar-header {
  padding: 18px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.orayol-sidebar-toolbar {
  padding: 0 12px 12px;
  flex-shrink: 0;
}

.orayol-sidebar-new-conv {
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  border: 1px solid rgba(10, 10, 10, 0.12);
  background-color: #fff;
  color: var(--color--neutral-04);
  font-family: var(--font--primary-font);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.orayol-sidebar-new-conv:hover {
  background-color: rgba(255, 255, 255, 0.85);
  border-color: rgba(10, 10, 10, 0.18);
}

.orayol-sidebar-title {
  font-family: var(--font--primary-font);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--color--neutral-04);
  text-transform: uppercase;
  margin: 0;
}

.orayol-sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--color--neutral-04);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.orayol-sidebar-toggle:hover {
  background-color: rgba(10, 10, 10, 0.06);
}

.orayol-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 4px 8px 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.orayol-sidebar-empty {
  padding: 16px;
  font-family: var(--font--primary-font);
  font-size: 14px;
  color: var(--color--neutral-03);
  opacity: 0.8;
}

.orayol-sidebar-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font--primary-font);
  color: var(--color--neutral-04);
  background: transparent;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  width: 100%;
  text-align: left;
}

.orayol-sidebar-item:hover {
  background-color: rgba(255, 255, 255, 0.6);
}

.orayol-sidebar-item.is-active {
  background-color: #fff;
  border-color: rgba(10, 10, 10, 0.08);
  box-shadow: 0 2px 6px rgba(10, 10, 10, 0.04);
}

.orayol-sidebar-item-main {
  flex: 1;
  min-width: 0;
}

.orayol-sidebar-item-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.orayol-sidebar-item-meta {
  font-size: 12px;
  color: var(--color--neutral-03);
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

.orayol-sidebar-item-branch {
  font-size: 12px;
  color: var(--color--neutral-04);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.orayol-sidebar-item-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 4px;
  flex-shrink: 0;
  max-width: 96px;
}

.orayol-sidebar-item-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--color--theme-color-02, #ffce8a);
  color: var(--color--neutral-04);
  text-transform: uppercase;
}

.orayol-sidebar-item-badge.is-ref {
  background: rgba(10, 10, 10, 0.08);
  color: var(--color--neutral-04);
}

.orayol-sidebar-item-badge.is-ai {
  background: rgba(124, 58, 237, 0.14);
  color: #6d28d9;
}

.orayol-sidebar-item-badge.is-active {
  background: #16a34a;
  color: #fff;
}

.orayol-content {
  flex: 1;
  min-width: 0;
}

/* Right profile panel — symmetric to .orayol-sidebar */
.orayol-profile-panel {
  width: 280px;
  flex-shrink: 0;
  background: var(--color--theme-color-01, #e2f2fc);
  border-left: 1px solid rgba(10, 10, 10, 0.06);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, width 0.25s ease;
  position: relative;
  z-index: 30;
  overflow: hidden;
}

.orayol-profile-panel.is-collapsed {
  width: 0;
  min-width: 0;
  transform: translateX(100%);
  border-left: 0;
  pointer-events: none;
}

.orayol-profile-panel-body {
  padding: 0 16px 16px;
  overflow-y: auto;
  flex: 1;
}

/* Header toggle button (hamburger + "Geçmiş" label) */
.orayol-header-toggle {
  background: transparent;
  border: 1px solid transparent;
  color: var(--color--neutral-04);
  cursor: pointer;
  height: 38px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font--primary-font);
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

.orayol-header-toggle:hover {
  background-color: rgba(10, 10, 10, 0.05);
  border-color: rgba(10, 10, 10, 0.08);
}

.orayol-header-toggle-label {
  letter-spacing: 0.01em;
}

/* In-panel close (×) button — visible primarily on mobile */
.orayol-panel-close-btn {
  background: transparent;
  border: none;
  color: var(--color--neutral-04);
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
  flex-shrink: 0;
}

.orayol-panel-close-btn:hover {
  background-color: rgba(10, 10, 10, 0.08);
}

/* Backdrop overlay (mobile only) */
.orayol-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.4);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.orayol-panel-backdrop[hidden] {
  display: none;
}

.orayol-panel-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Profile toggle (right side of header) */
.orayol-profile-toggle {
  background: transparent;
  border: 1px solid transparent;
  color: var(--color--neutral-04);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  font-family: var(--font--primary-font);
  transition: background-color 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

.orayol-profile-toggle:hover {
  background-color: rgba(10, 10, 10, 0.05);
  border-color: rgba(10, 10, 10, 0.08);
}

.orayol-profile-toggle-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: right;
}

.orayol-profile-toggle-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color--theme-color-02, #ffce8a);
  color: var(--color--neutral-04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.orayol-profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(10, 10, 10, 0.06);
}

.orayol-profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: var(--color--neutral-04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

/* Availability toggle (doctor only) */
.orayol-availability-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-family: var(--font--primary-font);
  font-size: 13px;
  color: var(--color--neutral-04);
}

.orayol-availability-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.orayol-availability-track {
  position: relative;
  width: 40px;
  height: 22px;
  background: #d0d5dd;
  border-radius: 999px;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
  display: inline-block;
}

.orayol-availability-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(10, 10, 10, 0.2);
  transition: transform 0.2s ease;
}

.orayol-availability-toggle input:checked ~ .orayol-availability-track {
  background: #16a34a;
}

.orayol-availability-toggle input:checked ~ .orayol-availability-track .orayol-availability-thumb {
  transform: translateX(18px);
}

.orayol-availability-toggle input:focus-visible ~ .orayol-availability-track {
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25);
}

.orayol-availability-label {
  font-weight: 600;
}

.orayol-availability-toggle:not(.is-on) .orayol-availability-label {
  color: #b42318;
}

.orayol-availability-toggle.is-on .orayol-availability-label {
  color: #16a34a;
}

.orayol-availability-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--color--neutral-03);
  font-family: var(--font--primary-font);
}

/* Doctor chip + empty hint inside profile panel: show only one of them. */
#profile-doctor-chip-section .orayol-doctor-chip:not([hidden]) + #profile-doctor-chip-empty {
  display: none;
}

.orayol-profile-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--color--neutral-04);
}

.orayol-profile-email {
  font-size: 12px;
  color: var(--color--neutral-03);
}

.orayol-profile-section {
  margin-top: 12px;
}

.orayol-profile-section-title {
  font-size: 11px;
  letter-spacing: 0.06em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color--neutral-03);
  margin: 0 0 6px;
}

.orayol-profile-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--color--neutral-04);
  padding: 6px 0;
}

.orayol-profile-row span:last-child {
  font-weight: 600;
  color: var(--color--neutral-03);
}

.orayol-specialty-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.orayol-specialty-option {
  appearance: none;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(10, 10, 10, 0.08);
  color: var(--color--neutral-04);
  font-family: var(--font--primary-font);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.orayol-specialty-option:hover {
  background-color: #ffffff;
}

.orayol-specialty-option.is-active {
  background-color: #ffffff;
  border-color: var(--color--neutral-04);
  font-weight: 600;
}

.orayol-profile-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.orayol-profile-btn-secondary {
  background: var(--color--theme-color-01, #e2f2fc);
  color: var(--color--neutral-04);
  border: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: var(--font--primary-font);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.orayol-profile-btn-secondary[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.orayol-profile-btn-secondary:not([disabled]):hover {
  background: #d6ebf7;
}

.orayol-profile-btn-danger {
  background: #fef3f2;
  color: #b42318;
  border: 1px solid #fecdca;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: var(--font--primary-font);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.orayol-profile-btn-danger:hover {
  background: #fee4e2;
}

/* Desktop: panel başlığı kalır; × yalnız mobilde (üst bar toggle yeterli) */
@media (min-width: 901px) {
  #sidebar-close,
  #profile-panel-close {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* Mobile: sidebar + profile panel slide over content */
@media (max-width: 900px) {
  /* Hamburger yanındaki "Geçmiş" yazısı mobilde hiç görünmesin */
  .orayol-header-toggle-label {
    display: none !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .orayol-header-toggle {
    padding: 0 10px;
    gap: 0;
    border-radius: 10px;
  }

  .orayol-profile-toggle-info {
    display: none;
  }

  .orayol-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    width: min(85vw, 320px);
    box-shadow: 4px 0 18px rgba(10, 10, 10, 0.18);
    z-index: 50;
  }

  .orayol-profile-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    width: min(85vw, 320px);
    box-shadow: -4px 0 18px rgba(10, 10, 10, 0.18);
    z-index: 50;
  }

  .orayol-content {
    width: 100%;
  }

  body.orayol-sidebar-collapsed .orayol-sidebar {
    transform: translateX(-100%);
  }

  body.orayol-profile-collapsed .orayol-profile-panel {
    transform: translateX(100%);
  }
}
