/**
 * ADHD Patient Documents & Reports styles.
 *
 * Covers the admin/prescriber editor (.woopw-adhd-docs) and the patient-facing "Reports" endpoint
 * (.woopw-reports). Enqueued as woopw-adhd-documents-css. No inline CSS.
 */

/* ------------------------------------------------------------- Admin / prescriber editor */
.woopw-adhd-docs {
	margin: 0;
}

.woopw-adhd-docs-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

.woopw-adhd-docs-form textarea {
	width: 100%;
	max-width: 100%;
}

/* WP rich editor (wp_editor) used for the Note field. */
.woopw-adhd-docs-form .wp-editor-wrap {
	margin-bottom: 12px;
}

.woopw-adhd-doc-note-label {
	margin-bottom: 4px;
}

.woopw-adhd-docs-form input[type="file"] {
	max-width: 100%;
}

/* Pre-submit patient-visibility toggles (order + PMR editor): choose whether the note / document is
   shown to the patient BEFORE uploading and notifying. */
.woopw-adhd-doc-prefs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	margin: 4px 0 12px;
}
.woopw-adhd-doc-prefs .woopw-adhd-doc-pref-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: 13px;
}
.woopw-adhd-doc-prefs .woopw-adhd-doc-pref {
	margin: 0;
}

.woopw-adhd-doc-msg {
	margin-left: 8px;
	font-style: italic;
}

.woopw-adhd-docs-list {
	margin-top: 12px;
}

.woopw-adhd-docs-items {
	list-style: none !important;
	margin: 0;
	padding: 0;
}

.woopw-adhd-doc-item {
	border: 1px solid #e2e4e7;
	border-radius: 4px;
	padding: 10px 12px;
	margin-bottom: 8px;
	background: #fff;
	position: relative;
}

/* Remove the theme's default list bullet on each document row (the frontend prescriber dashboard adds a
   disc marker on <li> that the plain list-style:none above does not beat). */
.woopw-adhd-docs-items > li.woopw-adhd-doc-item {
	list-style: none !important;
	list-style-type: none !important;
}

.woopw-adhd-docs-items > li.woopw-adhd-doc-item::marker {
	content: "";
}

.woopw-adhd-docs-items > li.woopw-adhd-doc-item::before {
	content: none !important;
	display: none !important;
}

.woopw-adhd-doc-meta {
	font-size: 12px;
	color: #646970;
	margin-bottom: 4px;
	/* Reserve space for the absolutely-positioned "Remove" link (top-right) so the date + author never slide
	   UNDER it and overlap on narrow widths (e.g. the prescriber review popup on mobile). Width-independent,
	   so it holds in the modal at any device size. */
	padding-right: 76px;
}

.woopw-adhd-doc-order {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 6px;
	background: #f0f0f1;
	border-radius: 3px;
}

.woopw-adhd-doc-note-text {
	margin: 4px 0;
}

.woopw-adhd-doc-file a {
	font-weight: 600;
	word-break: break-all;
}

.woopw-adhd-doc-remove {
	position: absolute;
	top: 8px;
	right: 10px;
	/* Reset the native <button> chrome (the `button-link` WP-admin class only resets it inside wp-admin,
	   so on the frontend prescriber dashboard the button kept its default bordered box). This renders a
	   clean, theme-neutral red text link in every context. */
	appearance: none;
	-webkit-appearance: none;
	background: none;
	border: 0;
	margin: 0;
	padding: 2px 4px;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	color: #b32d2e;
	text-decoration: underline;
	cursor: pointer;
}

.woopw-adhd-doc-remove:hover,
.woopw-adhd-doc-remove:focus {
	color: #8a2424;
	text-decoration: none;
}

/* Narrow screens (prescriber review popup on mobile / small devices): drop the absolute "Remove" out of the
   top-right corner - where it overlapped the date + author - and flow it as its own right-aligned line at the
   bottom of the document row. The meta then no longer needs the reserved right gap. Responsive on all devices. */
@media (max-width: 782px) {
	.woopw-adhd-doc-meta {
		padding-right: 0;
	}
	.woopw-adhd-doc-remove {
		position: static;
		display: block;
		width: -moz-fit-content;
		width: fit-content;
		margin: 8px 0 0 auto;
		padding: 4px 0;
	}
}

/* Patient-visibility toggle switches (PMR / order editor). */
.woopw-adhd-doc-visibility {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin: 8px 0 4px;
}

.woopw-adhd-doc-switch {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 12px;
	color: #50575e;
	user-select: none;
}

.woopw-adhd-doc-switch input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.woopw-adhd-doc-slider {
	position: relative;
	width: 34px;
	height: 18px;
	flex: 0 0 auto;
	background: #c3c4c7;
	border-radius: 999px;
	transition: background 0.15s ease;
}

.woopw-adhd-doc-slider::before {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 14px;
	height: 14px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.15s ease;
}

.woopw-adhd-doc-switch input:checked + .woopw-adhd-doc-slider {
	background: #2271b1;
}

.woopw-adhd-doc-switch input:checked + .woopw-adhd-doc-slider::before {
	transform: translateX(16px);
}

.woopw-adhd-doc-switch input:focus + .woopw-adhd-doc-slider {
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.4);
}

.woopw-adhd-docs-empty {
	color: #646970;
	font-style: italic;
}

/* --------------------------------------------------------------- Patient "Reports" page */
.woopw-reports-title {
	margin-bottom: 6px;
}

.woopw-reports-intro {
	color: #555;
	margin-bottom: 18px;
}

.woopw-reports-list {
	list-style: none !important;
	margin: 0;
	padding: 0;
}

/* Remove the theme's default list bullet on each report row. */
.woopw-reports-list > li.woopw-reports-item {
	list-style: none !important;
	list-style-type: none !important;
}

.woopw-reports-list > li.woopw-reports-item::marker {
	content: "";
}

.woopw-reports-list > li.woopw-reports-item::before {
	content: none !important;
	display: none !important;
}

.woopw-reports-item {
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	padding: 16px 18px;
	margin-bottom: 14px;
	margin-left: 0;
	background: #fff;
}

.woopw-reports-item-head {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 8px;
	font-size: 13px;
	color: #666;
}

.woopw-reports-order {
	padding: 2px 8px;
	background: #f2f4f7;
	border-radius: 4px;
}

.woopw-reports-note {
	margin-bottom: 10px;
}

.woopw-reports-download {
	display: inline-block;
	word-break: break-all;
}

.woopw-reports-empty {
	color: #666;
	font-style: italic;
}
