/* Webbytroops Table Widget — frontend styles */

/* ------------------------------------------------------------------ */
/* Wrapper                                                             */
/* ------------------------------------------------------------------ */
.wbt__wrapper {
	position: relative;
	font-family: inherit;
}

/* ------------------------------------------------------------------ */
/* Search box                                                          */
/* ------------------------------------------------------------------ */
.wbt__search-wrap {
	margin-bottom: 12px;
}

.wbt__search-input {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 9px 14px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 0.875em;
	font-family: inherit;
	color: #374151;
	background-color: #fff;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
}

.wbt__search-input:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ------------------------------------------------------------------ */
/* Scroll wrapper                                                       */
/* ------------------------------------------------------------------ */
.wbt--responsive .wbt__scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* ------------------------------------------------------------------ */
/* Table base                                                          */
/* ------------------------------------------------------------------ */
.wbt__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	text-align: left;
}

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */
.wbt__table thead th {
	padding: 10px 14px;
	background-color: #f8fafc;
	color: #1e293b;
	font-weight: 600;
	font-size: 0.8125em;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
	vertical-align: middle;
}

.wbt--bordered .wbt__table thead th {
	border: 1px solid #e2e8f0;
}

.wbt__table thead tr {
	border-bottom: 2px solid #cbd5e1;
}

.wbt__th-inner {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* ------------------------------------------------------------------ */
/* Sort icon                                                           */
/* ------------------------------------------------------------------ */
.wbt__table thead th[data-sortable] {
	cursor: pointer;
	user-select: none;
}

.wbt__table thead th[data-sortable]:hover {
	background-color: #f1f5f9;
}

.wbt__sort-icon {
	display: inline-flex;
	flex-direction: column;
	gap: 2px;
	opacity: 0.4;
	flex-shrink: 0;
	transition: opacity 0.15s;
}

.wbt__sort-icon::before,
.wbt__sort-icon::after {
	content: '';
	display: block;
	width: 0;
	height: 0;
}

.wbt__sort-icon::before {
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-bottom: 5px solid currentColor;
}

.wbt__sort-icon::after {
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
}

thead th[aria-sort="ascending"]  .wbt__sort-icon,
thead th[aria-sort="descending"] .wbt__sort-icon {
	opacity: 1;
}

thead th[aria-sort="ascending"]  .wbt__sort-icon::after  { opacity: 0.25; }
thead th[aria-sort="descending"] .wbt__sort-icon::before { opacity: 0.25; }

/* ------------------------------------------------------------------ */
/* Body rows                                                           */
/* ------------------------------------------------------------------ */
.wbt__table tbody td {
	padding: 10px 14px;
	color: #334155;
	vertical-align: middle;
}

.wbt--bordered .wbt__table tbody td {
	border: 1px solid #e2e8f0;
}

.wbt__table tbody tr {
	transition: background-color 0.1s ease;
}

.wbt--bordered .wbt__table tbody tr {
	border-bottom: 1px solid #e2e8f0;
}

/* Striped */
.wbt--striped .wbt__table tbody tr:nth-child(odd)  { background-color: #ffffff; }
.wbt--striped .wbt__table tbody tr:nth-child(even) { background-color: #f8fafc; }

/* Hover */
.wbt--hover .wbt__table tbody tr:hover { background-color: #eff6ff !important; }

/* Linked row cursor */
.wbt__row--linked { cursor: pointer; }

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */
.wbt__table tfoot td {
	padding: 10px 14px;
	font-weight: 600;
	color: #1e293b;
	background-color: #f8fafc;
}

.wbt__table tfoot tr {
	border-top: 2px solid #cbd5e1;
}

.wbt--bordered .wbt__table tfoot td {
	border: 1px solid #e2e8f0;
}

/* ------------------------------------------------------------------ */
/* No-results row (injected by JS)                                     */
/* ------------------------------------------------------------------ */
.wbt__no-results td {
	text-align: center !important;
	padding: 20px 14px !important;
	color: #94a3b8 !important;
	font-style: italic;
}

/* ------------------------------------------------------------------ */
/* Editor placeholder                                                  */
/* ------------------------------------------------------------------ */
.elementor-editor-active .wbt__wrapper:empty::after {
	content: 'WT Table: Add columns & rows in the panel.';
	display: block;
	padding: 20px;
	text-align: center;
	color: #aaa;
	border: 1px dashed #ccc;
	border-radius: 4px;
}
