/**
 * Training Manager - Public Styles
 *
 * @package TrainingManager
 * @since   1.1.0
 */

/* ---- General ---- */

.tm-login-required {
	padding: 20px;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 6px;
	text-align: center;
	color: #666;
}

.tm-notice {
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 20px;
}

.tm-notice-success {
	background: #d4edda;
	border: 1px solid #c3e6cb;
	color: #155724;
}

.tm-notice-info {
	background: #cff4fc;
	border: 1px solid #b6effb;
	color: #055160;
}

/* ---- Pathway Selector ---- */

.tm-pathway-selector h2 {
	margin-bottom: 8px;
}

.tm-selector-intro {
	color: #555;
	margin-bottom: 24px;
	font-size: 1.05em;
}

.tm-no-pathways {
	padding: 40px 20px;
	background: #f9f9f9;
	border: 2px dashed #ddd;
	border-radius: 8px;
	text-align: center;
	color: #888;
}

/* Card grid */
.tm-pathway-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
}

.tm-pathway-card {
	background: #fff;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	padding: 24px;
	display: flex;
	flex-direction: column;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.tm-pathway-card:hover {
	border-color: #2271b1;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tm-pathway-current {
	border-color: #2271b1;
	background: #f0f6fc;
}

.tm-pathway-card-header {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

.tm-pathway-card-title {
	margin: 0;
	font-size: 1.2em;
	line-height: 1.3;
}

.tm-current-badge {
	display: inline-block;
	background: #2271b1;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 3px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	white-space: nowrap;
}

.tm-pending-badge {
	display: inline-block;
	background: #856404;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 3px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	white-space: nowrap;
}

/* Pending pathway card state */
.tm-pathway-pending {
	border-color: #ffc107;
	background: #fffbf0;
}

.tm-pathway-pending:hover {
	border-color: #e0a800;
}

/* Other-pending: a different pathway already has a pending request */
.tm-pathway-other-pending {
	opacity: 0.65;
	background: #fafafa;
}

.tm-pathway-other-pending:hover {
	border-color: #e0e0e0;
	box-shadow: none;
}

.tm-pathway-card-desc {
	color: #555;
	font-size: 0.95em;
	line-height: 1.5;
	flex-grow: 1;
	margin-bottom: 16px;
}

.tm-pathway-card-meta {
	margin-bottom: 16px;
	padding-top: 12px;
	border-top: 1px solid #eee;
}

.tm-pathway-session-count {
	font-size: 0.9em;
	color: #666;
	font-weight: 600;
}

/* Denied request note */
.tm-request-denied-note {
	background: #f8d7da;
	border: 1px solid #f5c2c7;
	border-radius: 4px;
	color: #842029;
	font-size: 0.88em;
	line-height: 1.5;
	margin-bottom: 12px;
	padding: 8px 12px;
}

/* Buttons */
.tm-pathway-card-action {
	margin-top: auto;
}

.tm-btn {
	display: inline-block;
	padding: 10px 20px;
	border-radius: 5px;
	font-size: 0.95em;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	border: none;
	width: 100%;
	box-sizing: border-box;
}

.tm-btn-select {
	background: #2271b1;
	color: #fff;
	transition: background 0.2s;
}

.tm-btn-select:hover {
	background: #135e96;
}

.tm-btn-current {
	background: transparent;
	border: 2px solid #2271b1;
	color: #2271b1;
	cursor: default;
}

.tm-btn-pending {
	background: transparent;
	border: 2px solid #ffc107;
	color: #856404;
	cursor: default;
}

.tm-btn-other-pending {
	background: transparent;
	border: 2px solid #dee2e6;
	color: #6c757d;
	cursor: not-allowed;
	opacity: 0.8;
}

/* ---- Pathway Progress ---- */

/* Approval notice */
.tm-approval-notice {
	background: #d4edda;
	border: 1px solid #c3e6cb;
	border-left: 4px solid #28a745;
	color: #155724;
	padding-right: 44px;
	position: relative;
	margin-bottom: 16px;
}

.tm-approval-notice p {
	margin: 0;
	line-height: 1.6;
}

.tm-approval-notice-dismiss {
	position: absolute;
	top: 10px;
	right: 12px;
	background: none;
	border: none;
	color: #155724;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	opacity: 0.6;
}

.tm-approval-notice-dismiss:hover {
	opacity: 1;
}


/* Pending switch notice shown above approved pathway progress */
.tm-pending-switch-notice {
	margin-bottom: 16px;
}

/* States when there is no approved pathway yet */
.tm-pathway-progress-pending,
.tm-pathway-progress-denied {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 24px;
}

.tm-pathway-progress-pending {
	border-left: 4px solid #ffc107;
}

.tm-pathway-progress-denied {
	border-left: 4px solid #dc3545;
}

.tm-request-status-message {
	margin: 0 0 8px;
	line-height: 1.6;
}

.tm-request-status-hint {
	color: #666;
	font-size: 0.9em;
	margin: 0;
}

.tm-pathway-progress {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 24px;
}

.tm-progress-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}

.tm-progress-title {
	margin: 0;
	font-size: 1.15em;
}

.tm-progress-stats {
	font-size: 0.9em;
	color: #666;
}

/* Progress bar */
.tm-progress-bar-wrap {
	background: #e9ecef;
	border-radius: 20px;
	height: 24px;
	overflow: hidden;
	margin-bottom: 20px;
}

.tm-progress-bar {
	background: #28a745;
	height: 100%;
	border-radius: 20px;
	min-width: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: width 0.4s ease;
}

.tm-progress-bar-text {
	color: #fff;
	font-size: 12px;
	font-weight: 700;
}

/* Session list */
.tm-session-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tm-session-list .tm-session-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 0;
	border-bottom: 1px solid #f0f0f0;
}

.tm-session-list .tm-session-item:last-child {
	border-bottom: none;
}

.tm-session-icon {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	border-radius: 50%;
}

.tm-session-completed .tm-session-icon {
	background: #d4edda;
	color: #155724;
}

.tm-session-in-progress .tm-session-icon {
	background: #fff3cd;
	color: #856404;
}

.tm-session-not-started .tm-session-icon {
	background: #f0f0f1;
	color: #999;
}

.tm-session-link {
	flex: 1;
	text-decoration: none;
	color: #1e1e1e;
}

a.tm-session-link:hover {
	color: #2271b1;
}

.tm-session-completed .tm-session-link {
	text-decoration: line-through;
	color: #666;
}

.tm-session-status-label {
	font-size: 0.8em;
	color: #888;
	white-space: nowrap;
}

/* "View Available Sessions" button in pathway progress */
.tm-btn-sessions-link {
	display: inline-block;
	padding: 4px 12px;
	background: #cff4fc;
	color: #055160;
	border: 1px solid #b6effb;
	border-radius: 4px;
	font-size: 0.85em;
	font-weight: 600;
	text-decoration: none;
	margin-left: 8px;
	white-space: nowrap;
}

.tm-btn-sessions-link:hover {
	background: #b6effb;
	color: #044959;
}

/* Upcoming sessions in pathway progress widget */
.tm-upcoming-sessions {
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid #f0f0f0;
}

.tm-upcoming-sessions-title {
	margin: 0 0 12px;
	font-size: 1em;
	color: #1e1e1e;
}

.tm-upcoming-session-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tm-upcoming-session-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid #f5f5f5;
	flex-wrap: wrap;
}

.tm-upcoming-session-item:last-child {
	border-bottom: none;
}

.tm-upcoming-session-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.tm-upcoming-session-info strong {
	font-size: 0.95em;
}

.tm-upcoming-session-when,
.tm-upcoming-session-loc {
	font-size: 0.85em;
	color: #646970;
}

.tm-btn-cancel-small {
	font-size: 0.8em;
	color: #b32d2e;
	text-decoration: none;
	white-space: nowrap;
}

.tm-btn-cancel-small:hover {
	color: #d63638;
}

/* ---- Module Session List ([tm_module_sessions]) ---- */

.tm-session-list-wrap {
	margin: 0;
}

.tm-session-list-heading {
	margin-top: 0;
	margin-bottom: 20px;
}

.tm-no-sessions {
	padding: 32px 20px;
	background: #f9f9f9;
	border: 2px dashed #ddd;
	border-radius: 8px;
	text-align: center;
	color: #666;
}

.tm-contact-link {
	color: #2271b1;
}

/* Session cards grid */
.tm-session-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 20px;
}

.tm-session-card {
	background: #fff;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	position: relative;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.tm-session-card:hover {
	border-color: #2271b1;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tm-session-card-registered {
	border-color: #28a745;
	background: #f0fff4;
}

.tm-session-card-unavailable {
	opacity: 0.75;
}

/* Status badge on card */
.tm-session-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	align-self: flex-start;
}

.tm-badge-registered {
	background: #d4edda;
	color: #155724;
}

.tm-badge-full {
	background: #fff3cd;
	color: #856404;
}

.tm-badge-cancelled,
.tm-badge-past {
	background: #f0f0f1;
	color: #646970;
}

/* Card fields */
.tm-session-card-datetime {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.tm-session-card-date {
	font-size: 1.1em;
	font-weight: 700;
	color: #1e1e1e;
}

.tm-session-card-time {
	font-size: 0.95em;
	color: #555;
}

.tm-session-card-location,
.tm-session-card-instructor {
	font-size: 0.9em;
	color: #555;
}

.tm-session-card-location a {
	color: #2271b1;
	text-decoration: none;
}

.tm-session-card-location a:hover {
	text-decoration: underline;
}

.tm-icon {
	margin-right: 4px;
}

.tm-session-card-spots {
	font-size: 0.88em;
	font-weight: 600;
	color: #28a745;
}

.tm-spots-full {
	color: #b32d2e;
}

.tm-session-card-notes {
	font-size: 0.88em;
	color: #555;
	background: #f9f9f9;
	border-left: 3px solid #ddd;
	padding: 8px 12px;
	border-radius: 0 4px 4px 0;
}

/* Card action buttons */
.tm-session-card-actions {
	margin-top: auto;
	padding-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tm-btn-register {
	background: #2271b1;
	color: #fff !important;
	padding: 10px 18px;
	border-radius: 5px;
	font-weight: 600;
	font-size: 0.95em;
	text-align: center;
	text-decoration: none !important;
	cursor: pointer;
	border: none;
	width: 100%;
	box-sizing: border-box;
	transition: background 0.2s;
}

.tm-btn-register:hover {
	background: #135e96;
}

.tm-btn-registered {
	background: transparent;
	border: 2px solid #28a745;
	color: #155724 !important;
	padding: 10px 18px;
	border-radius: 5px;
	font-weight: 600;
	font-size: 0.95em;
	text-align: center;
	cursor: default;
	display: block;
}

.tm-btn-full {
	background: transparent;
	border: 2px solid #dee2e6;
	color: #6c757d !important;
	padding: 10px 18px;
	border-radius: 5px;
	font-weight: 600;
	font-size: 0.95em;
	text-align: center;
	cursor: not-allowed;
	display: block;
}

.tm-btn-calendar {
	display: block;
	text-align: center;
	padding: 8px 16px;
	background: #f0f6fc;
	border: 1px solid #b6d8f7;
	color: #2271b1 !important;
	border-radius: 5px;
	font-size: 0.9em;
	font-weight: 600;
	text-decoration: none !important;
}

.tm-btn-calendar:hover {
	background: #dbeafe;
}

.tm-btn-cancel {
	display: block;
	text-align: center;
	padding: 6px 14px;
	background: transparent;
	border: 1px solid #f5c2c7;
	color: #842029 !important;
	border-radius: 5px;
	font-size: 0.88em;
	text-decoration: none !important;
}

.tm-btn-cancel:hover {
	background: #f8d7da;
}

.tm-cancel-cutoff-note {
	font-size: 0.8em;
	color: #888;
	text-align: center;
	margin: 0;
}

.tm-contact-hint {
	font-size: 0.82em;
	text-align: center;
	color: #888;
	margin: 0;
}

.tm-contact-hint a {
	color: #888;
}

.tm-session-cant-make {
	margin-top: 20px;
	text-align: center;
	color: #666;
	font-size: 0.9em;
}

/* ---- My Sessions ([tm_my_sessions]) ---- */

.tm-my-sessions {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 20px;
}

.tm-my-sessions-title {
	margin: 0 0 16px;
	font-size: 1.1em;
}

.tm-my-session-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tm-my-session-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid #f5f5f5;
	flex-wrap: wrap;
}

.tm-my-session-item:last-child {
	border-bottom: none;
}

.tm-my-session-info {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.tm-my-session-when,
.tm-my-session-loc {
	font-size: 0.88em;
	color: #646970;
}

.tm-my-session-actions {
	display: flex;
	gap: 8px;
	align-items: center;
}

.tm-btn-calendar-small {
	font-size: 0.85em;
	padding: 5px 10px;
	background: #f0f6fc;
	border: 1px solid #b6d8f7;
	color: #2271b1;
	border-radius: 4px;
	text-decoration: none;
}

.tm-btn-calendar-small:hover {
	background: #dbeafe;
}

.tm-no-upcoming-sessions {
	color: #666;
	text-align: center;
	padding: 20px;
}

/* ---- Volunteer Application Form ([tm_volunteer_apply]) ---- */

.tm-volunteer-apply {
	max-width: 680px;
}

.tm-apply-success {
	font-size: 1.05em;
}

.tm-notice-error {
	background: #f8d7da;
	border: 1px solid #f5c2c7;
	color: #842029;
}

.tm-application-form {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 28px 32px;
}

.tm-apply-field-group {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.tm-apply-field {
	margin-bottom: 20px;
}

.tm-apply-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	color: #1e1e1e;
}

.tm-apply-field input[type="text"],
.tm-apply-field input[type="email"],
.tm-apply-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 9px 12px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: 1em;
	color: #1e1e1e;
	background: #fff;
	transition: border-color 0.15s;
}

.tm-apply-field input[type="text"]:focus,
.tm-apply-field input[type="email"]:focus,
.tm-apply-field textarea:focus {
	border-color: #2271b1;
	outline: none;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.tm-apply-field textarea {
	resize: vertical;
}

.tm-apply-help {
	font-size: 0.88em;
	color: #646970;
	margin: 0 0 6px;
}

.tm-required {
	color: #d63638;
	margin-left: 2px;
}

.tm-optional {
	font-weight: normal;
	color: #646970;
	font-size: 0.88em;
	margin-left: 4px;
}

.tm-apply-required-note {
	font-size: 0.85em;
	color: #646970;
	margin: 0 0 20px;
}

.tm-apply-submit {
	margin: 0;
}

.tm-btn-apply {
	background: #2271b1;
	color: #fff;
	padding: 12px 28px;
	border-radius: 5px;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: background 0.2s;
	width: auto;
}

.tm-btn-apply:hover {
	background: #135e96;
}

/* Responsive */
@media screen and (max-width: 600px) {
	.tm-pathway-cards {
		grid-template-columns: 1fr;
	}

	.tm-progress-header {
		flex-direction: column;
	}

	.tm-session-cards {
		grid-template-columns: 1fr;
	}

	.tm-upcoming-session-item {
		flex-direction: column;
		align-items: flex-start;
	}

	.tm-my-session-item {
		flex-direction: column;
		align-items: flex-start;
	}

	.tm-apply-field-group {
		grid-template-columns: 1fr;
	}

	.tm-application-form {
		padding: 20px 16px;
	}
}

/* ---- Pathway Type badges (selector cards) ---- */

.tm-pathway-type-badge {
	display: inline-block;
	padding: 2px 7px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	white-space: nowrap;
}

.tm-pathway-type-required {
	background: #d4edda;
	color: #155724;
}

.tm-pathway-type-flexible {
	background: #cff4fc;
	color: #055160;
}

.tm-pathway-type-suggested {
	background: #f0f0f1;
	color: #646970;
}

/* Requirements text on selector cards */
.tm-pathway-req-text {
	display: block;
	font-size: 0.85em;
	color: #666;
	margin-top: 4px;
}

/* ---- Progress widget: flexible pathway sections ---- */

.tm-progress-section {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid #eee;
}

.tm-progress-section-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.tm-progress-section-title {
	margin: 0;
	font-size: 1em;
	font-weight: 600;
}

.tm-progress-bar-wrap-sm {
	margin-bottom: 12px;
}

.tm-progress-bar-elective {
	background: #0ea5e9;
}

.tm-progress-bar-suggested {
	background: #6b7280;
}

.tm-complete-badge {
	display: inline-block;
	background: #28a745;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 1px 7px;
	border-radius: 3px;
	white-space: nowrap;
}

.tm-progress-suggested-note {
	background: #f9f9f9;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	padding: 10px 14px;
	color: #555;
	font-size: 0.95em;
	margin-bottom: 16px;
}
