/**
 * LPVV Doctor Directory — Add-On Style Overrides  v0.3.0
 *
 * Loaded exclusively from the latepoint-livekit-visits add-on.
 * Does NOT require edits to LatePoint core stylesheets.
 *
 * Covers:
 *   1. Filter panel: gradient header, refined spacing, sticky scroll.
 *   2. Filter option rows: RTL-aware selected state with accent border.
 *   3. Radio inputs: custom appearance with visible dot.
 *   4. Toggle switch: proper pill shape (fixes core override regression).
 *   5. Long-text handling for specialty names in narrow sidebar.
 *   6. CSS safety net: hide gender filter + gender tags.
 */

/* ------------------------------------------------------------------ *
 *  Filter panel shell
 * ------------------------------------------------------------------ */
.salamat-doctor-directory .sdd-filter-panel {
	background: #ffffff;
	border: 1.5px solid rgba(38, 45, 96, 0.1);
	border-radius: 18px;
	box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
	overflow: hidden;
	padding: 0;
	position: sticky;
	top: 7rem;
}

/* ------------------------------------------------------------------ *
 *  Filter panel header — gradient
 * ------------------------------------------------------------------ */
.salamat-doctor-directory .sdd-filter-panel-head {
	align-items: center;
	background: linear-gradient(135deg, #262d60 0%, #39438d 100%);
	color: #ffffff;
	display: flex;
	justify-content: space-between;
	padding: 1rem 1.25rem;
}

.salamat-doctor-directory .sdd-filter-panel-head h2 {
	color: #ffffff;
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	margin: 0;
}

/* ------------------------------------------------------------------ *
 *  Clear-filters button (inside header)
 * ------------------------------------------------------------------ */
.salamat-doctor-directory .sdd-clear-filters {
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 999px;
	color: #ffffff;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1;
	padding: 0.35rem 0.8rem;
	transition: background 0.15s ease;
}

.salamat-doctor-directory .sdd-clear-filters:hover {
	background: rgba(255, 255, 255, 0.28);
}

/* ------------------------------------------------------------------ *
 *  Filter group container
 * ------------------------------------------------------------------ */
.salamat-doctor-directory .sdd-filter-group {
	padding: 1rem 1.25rem;
}

.salamat-doctor-directory .sdd-filter-group + .sdd-filter-group {
	border-top: 1px solid rgba(15, 23, 42, 0.07);
	padding-top: 1rem;
}

/* ------------------------------------------------------------------ *
 *  Filter group title
 * ------------------------------------------------------------------ */
.salamat-doctor-directory .sdd-filter-title {
	color: #334155;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	margin: 0;
	text-transform: uppercase;
}

/* ------------------------------------------------------------------ *
 *  Options list grid
 * ------------------------------------------------------------------ */
.salamat-doctor-directory .sdd-filter-options {
	display: grid;
	gap: 0.25rem;
	margin-top: 0.65rem;
}

/* ------------------------------------------------------------------ *
 *  Individual filter option row (radio)
 * ------------------------------------------------------------------ */
.salamat-doctor-directory .sdd-filter-option {
	align-items: flex-start;
	border-radius: 8px;
	border-inline-end: 3px solid transparent;
	color: #475569;
	cursor: pointer;
	direction: ltr;
	display: flex;
	font-size: 0.875rem;
	gap: 0.6rem;
	padding: 0.4rem 0.5rem;
	padding-inline-end: calc(0.5rem - 3px);
	text-align: right;
	transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
	width: 100%;
}

.salamat-doctor-directory .sdd-filter-option:hover {
	background: rgba(38, 45, 96, 0.05);
	color: #1e293b;
}

/* Selected state — highlighted row + accent border on the RTL end */
.salamat-doctor-directory .sdd-filter-option:has( input:checked ) {
	background: rgba(38, 45, 96, 0.09);
	border-inline-end-color: #262d60;
	color: #1e2a5e;
	font-weight: 600;
}

/* ------------------------------------------------------------------ *
 *  Toggle option row (checkbox)
 * ------------------------------------------------------------------ */
.salamat-doctor-directory .sdd-toggle-option {
	align-items: center;
	border-radius: 8px;
	color: #475569;
	cursor: pointer;
	direction: ltr;
	display: flex;
	font-size: 0.875rem;
	gap: 0.65rem;
	padding: 0.4rem 0.5rem;
	text-align: right;
	transition: background 0.12s ease, color 0.12s ease;
	width: 100%;
}

.salamat-doctor-directory .sdd-toggle-option:hover {
	background: rgba(38, 45, 96, 0.05);
	color: #1e293b;
}

/* ------------------------------------------------------------------ *
 *  Option label text — long specialty names must wrap cleanly
 * ------------------------------------------------------------------ */
.salamat-doctor-directory .sdd-filter-option span,
.salamat-doctor-directory .sdd-toggle-option span {
	flex: 1 1 auto;
	hyphens: auto;
	line-height: 1.45;
	overflow-wrap: break-word;
	text-align: right;
	word-break: break-word;
}

/* ------------------------------------------------------------------ *
 *  Custom radio input
 * ------------------------------------------------------------------ */
.salamat-doctor-directory .sdd-filter-option input[type="radio"] {
	-webkit-appearance: none;
	appearance: none;
	background: #f1f5f9;
	border: 1.5px solid #cbd5e1;
	border-radius: 999px;
	cursor: pointer;
	flex: 0 0 17px;
	height: 17px;
	margin: 0;
	margin-top: 0.18em; /* align with first text line */
	position: relative;
	transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
	width: 17px;
}

.salamat-doctor-directory .sdd-filter-option input[type="radio"]::after {
	background: #ffffff;
	border-radius: 999px;
	content: "";
	height: 6px;
	inset: 50% auto auto 50%;
	opacity: 0;
	position: absolute;
	transform: translate(-50%, -50%);
	transition: opacity 0.15s ease;
	width: 6px;
}

.salamat-doctor-directory .sdd-filter-option input[type="radio"]:checked {
	background: #262d60;
	border-color: #262d60;
	box-shadow: 0 0 0 3px rgba(38, 45, 96, 0.14);
}

.salamat-doctor-directory .sdd-filter-option input[type="radio"]:checked::after {
	opacity: 1;
}

/* ------------------------------------------------------------------ *
 *  Toggle switch (pill) — "فقط پزشکان دارای نوبت امروز"
 *
 *  IMPORTANT: the core doctor-directory.css already styles this as a
 *  pill toggle, but this add-on previously overrode it with a small
 *  square (height/width 17px, border-radius 5px).  This block
 *  explicitly restores and improves the pill shape.
 * ------------------------------------------------------------------ */
.salamat-doctor-directory .sdd-toggle-option input[type="checkbox"] {
	-webkit-appearance: none;
	appearance: none;
	background: #cbd5e1;        /* neutral gray when off */
	border: none;
	border-radius: 999px;
	cursor: pointer;
	flex: 0 0 38px;
	height: 22px;
	margin: 0;
	position: relative;
	transition: background 0.2s ease;
	width: 38px;
}

.salamat-doctor-directory .sdd-toggle-option input[type="checkbox"]::after {
	background: #ffffff;
	border-radius: 999px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
	content: "";
	height: 16px;
	left: 3px;
	position: absolute;
	top: 3px;
	transition: left 0.2s ease;
	width: 16px;
}

.salamat-doctor-directory .sdd-toggle-option input[type="checkbox"]:checked {
	background: #0d9e6a;
	box-shadow: 0 0 0 3px rgba(13, 158, 106, 0.14);
}

.salamat-doctor-directory .sdd-toggle-option input[type="checkbox"]:checked::after {
	left: 19px;
}

/* ------------------------------------------------------------------ *
 *  CSS safety net — hide gender elements
 *  (JavaScript removal is the primary mechanism; this is a fallback)
 * ------------------------------------------------------------------ */
.salamat-doctor-directory .sdd-filter-group:has( input[data-filter-field="gender"] ) {
	display: none !important;
}

.salamat-doctor-directory .sdd-card-tags .sdd-tag:not( .sdd-tag-soft ) {
	display: none !important;
}
