/* ST Events Manager — Frontend Styles */

.st-em-wrap {
	max-width: 100%;
	margin: 1.5em 0;
	box-sizing: border-box;
}
.st-em-wrap *,
.st-em-wrap *::before,
.st-em-wrap *::after {
	box-sizing: border-box;
}

/* Toolbar */
.st-em-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}
.st-em-view-toggle {
	display: inline-flex;
	border: 1px solid #d0d5dd;
	border-radius: 6px;
	overflow: hidden;
}
.st-em-view-btn {
	background: #fff;
	border: none;
	padding: 6px 12px;
	font-size: 13px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: #444;
}
.st-em-view-btn + .st-em-view-btn {
	border-left: 1px solid #d0d5dd;
}
.st-em-view-btn.is-active {
	background: #2c3338;
	color: #fff;
}
.st-em-view-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* Manage button: small, icon-only, unobtrusive */
.st-em-manage-btn {
	background: transparent !important;
	border: 1px solid #d0d5dd !important;
	border-radius: 50%;
	width: 26px !important;
	height: 26px !important;
	min-width: 0 !important;
	padding: 0 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #8a8f98 !important;
	opacity: 0.7;
	line-height: 1 !important;
	transition: opacity 0.15s ease, color 0.15s ease;
}
.st-em-manage-btn:hover {
	opacity: 1;
	color: #2c3338 !important;
}
.st-em-manage-btn .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	color: inherit !important;
}
.st-em-editor-controls {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* "Edit events" button — reopens the manage modal without logging out */
.st-em-open-manage-btn {
	background: transparent !important;
	border: 1px solid #2271b1 !important;
	border-radius: 50%;
	width: 26px !important;
	height: 26px !important;
	min-width: 0 !important;
	padding: 0 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #2271b1 !important;
	line-height: 1 !important;
}
.st-em-open-manage-btn:hover {
	background: #2271b1 !important;
	color: #fff !important;
}
.st-em-open-manage-btn .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	color: inherit !important;
}

.st-em-manage-btn.is-logged-in {
	background: #333 !important;
	border-color: #333 !important;
	color: #fff !important;
	opacity: 1;
}
.st-em-manage-btn.is-logged-in:hover {
	background: #111 !important;
	border-color: #111 !important;
	color: #fff !important;
}
.st-em-manage-btn.is-logged-in .dashicons {
	color: #fff !important;
}

/* Events container */
.st-em-events-container[data-view="list"] {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.st-em-events-container[data-view="card"] {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 18px;
}

/* Individual event */
.st-em-event {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
}
.st-em-event-list {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px;
}
.st-em-event-list .st-em-thumb {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 6px;
	flex: 0 0 auto;
}
.st-em-event-card {
	display: flex;
	flex-direction: column;
}
.st-em-event-card .st-em-thumb {
	width: 100%;
	height: 150px;
	object-fit: cover;
	display: block;
}
.st-em-event-card .st-em-event-body {
	padding: 12px 14px;
}

.st-em-thumb-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f1f3f5;
	color: #b0b5bb;
}
.st-em-event-list .st-em-thumb-placeholder {
	width: 72px;
	height: 72px;
	border-radius: 6px;
}
.st-em-event-card .st-em-thumb-placeholder {
	width: 100%;
	height: 150px;
}
.st-em-thumb-placeholder .dashicons {
	font-size: 28px;
	width: 28px;
	height: 28px;
}

.st-em-event-title {
	margin: 0 0 4px;
	font-size: 16px;
	line-height: 1.3;
}
.st-em-event-title a {
	text-decoration: none;
	color: inherit;
}
.st-em-event-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	font-size: 13px;
	color: #5b6169;
}
.st-em-event-meta .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	vertical-align: -2px;
}

.st-em-empty {
	color: #777;
	font-style: italic;
}
.st-em-loadmore-wrap {
	text-align: center;
	margin-top: 16px;
}

/* Modal overlay */
.st-em-overlay {
	position: fixed;
	inset: 0;
	background: rgba(20, 22, 25, 0.55);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 5vh 16px;
	z-index: 100000;
	overflow-y: auto;
}
.st-em-modal {
	background: #fff;
	border-radius: 10px;
	padding: 24px 28px 28px;
	position: relative;
	width: 100%;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.st-em-modal-sm { max-width: 380px; }
.st-em-modal-lg { max-width: 760px; }
.st-em-modal h2 { margin-top: 0; }
.st-em-modal-close {
	position: absolute;
	top: 10px;
	right: 12px;
	background: none !important;
	border: none !important;
	font-size: 18px !important;
	line-height: 1 !important;
	padding: 4px 6px !important;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	cursor: pointer;
	color: #888 !important;
}
.st-em-modal-close:hover { color: #222; }

.st-em-modal label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
	font-size: 13px;
}
.st-em-modal input[type="text"],
.st-em-modal input[type="email"],
.st-em-modal input[type="password"],
.st-em-modal input[type="datetime-local"] {
	width: 100%;
	padding: 7px 9px;
	border: 1px solid #d0d5dd;
	border-radius: 5px;
}
.st-em-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 16px;
}
@media (max-width: 600px) {
	.st-em-field-row { grid-template-columns: 1fr; }
}

.st-em-form-msg {
	padding: 8px 10px;
	border-radius: 5px;
	font-size: 13px;
}
.st-em-form-msg.is-error { background: #fdeaea; color: #a02222; }
.st-em-form-msg.is-success { background: #eaf7ea; color: #227a22; }

.st-em-manage-search-row {
	display: flex;
	gap: 8px;
	margin-bottom: 14px;
	flex-wrap: wrap;
}
.st-em-manage-search-row input[type="text"] {
	flex: 1 1 200px;
}

.st-em-results-heading {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #8a8f98;
	margin: 0 0 6px;
}

.st-em-search-results {
	max-height: 320px;
	overflow-y: auto;
	border: 1px solid #eee;
	border-radius: 6px;
}
.st-em-search-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 8px 12px;
	border-bottom: 1px solid #f0f0f0;
	font-size: 13px;
}
.st-em-search-row:last-child { border-bottom: none; }
.st-em-search-row .st-em-sr-title { font-weight: 600; }
.st-em-search-row .st-em-sr-date { color: #777; margin-left: 6px; font-weight: 400; }
.st-em-search-row .st-em-sr-actions { display: flex; gap: 6px; white-space: nowrap; }
.st-em-search-row .st-em-sr-actions button { font-size: 12px; padding: 2px 8px; }

.st-em-back-to-search {
	background: none;
	border: none;
	color: #2271b1;
	cursor: pointer;
	padding: 0 0 10px;
	font-size: 13px;
}

.wp-editor-wrap { margin-bottom: 10px; }

/* Force the rich text editor toolbar to a clear dark theme, overriding
   any site theme .button styles that otherwise bleed into TinyMCE. */
.st-em-edit-form .wp-editor-container,
.st-em-edit-form .mce-toolbar-grp,
.st-em-edit-form .mce-statusbar {
	background: #333 !important;
	border-color: #333 !important;
}
.st-em-edit-form .mce-toolbar .mce-btn-group .mce-btn,
.st-em-edit-form .mce-toolbar .mce-btn-group .mce-btn button,
.st-em-edit-form .mce-listbox button {
	background: #333 !important;
	border-color: #333 !important;
	color: #fff !important;
}
.st-em-edit-form .mce-btn button .mce-ico,
.st-em-edit-form .mce-btn button .mce-txt,
.st-em-edit-form .mce-listbox button .mce-txt,
.st-em-edit-form .mce-listbox .mce-caret {
	color: #fff !important;
	border-top-color: #fff !important;
}
.st-em-edit-form .mce-btn.mce-active button,
.st-em-edit-form .mce-btn:hover button,
.st-em-edit-form .mce-listbox:hover button {
	background: #555 !important;
}
.st-em-edit-form .mce-btn-group:not(:first-child) {
	border-left-color: #555 !important;
}
.st-em-edit-form .wp-editor-tabs .wp-switch-editor {
	background: #333 !important;
	color: #fff !important;
	border-color: #333 !important;
}
.st-em-edit-form .wp-editor-tabs .wp-switch-editor.switch-tmce {
	background: #fff !important;
	color: #333 !important;
}
.st-em-edit-form .wp-media-buttons .button,
.st-em-edit-form .wp-media-buttons .button .dashicons {
	background: #333 !important;
	color: #fff !important;
	border-color: #333 !important;
}
.st-em-edit-form textarea#st_em_detail_editor {
	background: #fff !important;
	color: #222 !important;
}
