/**
 * Datei: custom-fields-admin.css
 * Autor: MARKS MEDIA
 * Zweck:
 *   Einheitliches Admin-Styling für die Verwaltung der Custom Fields.
 *   Tabs: Gruppen, Felder, Werte (Reload-basiert, kein JS-Wechsel)
 */

/* ============================================================
   1. Grundlayout – Struktur, Schrift, Abstände
   ============================================================ */
.wrap h1 {
	margin-bottom: 20px;
	font-weight: 600;
	color: #111827;
}

.wrap p.description {
	color: #555;
	font-size: 13px;
	line-height: 1.5;
	margin-bottom: 25px;
}

.mietp-cf-wrapper {
	display: flex;
	gap: 30px;
	align-items: flex-start;
	margin-top: 20px;
}

@media (max-width: 1000px) {
	.mietp-cf-wrapper {
		flex-direction: column;
	}
	.mietp-cf-form {
		order: 2;
		margin-top: 30px;
	}
}

/* ============================================================
   2. Tab-Navigation (Reload-basiert)
   ============================================================ */
.mietp-tabs-nav {
	display: flex;
	gap: 6px;
	border-bottom: 2px solid #e5e7eb;
	margin-bottom: 0;
}

.mietp-tab-button {
	background: #f9fafb;
	border: 1px solid #d1d5db;
	border-bottom: none;
	padding: 10px 16px;
	font-size: 14px;
	cursor: pointer;
	border-radius: 6px 6px 0 0;
	color: #374151;
	text-decoration: none;
	transition: all 0.2s ease;
	user-select: none;
}

.mietp-tab-button:hover {
	background: #f3f4f6;
}

.mietp-tab-button.active {
	background: #fff;
	color: #111827;
	border-color: #cbd5e1;
	border-bottom: 2px solid #fff;
	box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
	font-weight: 600;
}

@media (max-width: 782px) {
	.mietp-tabs-nav {
		flex-wrap: wrap;
	}
	.mietp-tab-button {
		flex: 1 1 auto;
		text-align: center;
	}
}

/* ============================================================
   3. Formularbereich (linke Spalte)
   ============================================================ */
.mietp-cf-form {
	flex: 0 0 28%;
	background: #fff;
	padding: 20px;
	border: 1px solid #ddd;
	border-radius: 6px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.form-table th {
	width: 140px;
	text-align: left;
	vertical-align: top;
	padding-top: 10px;
	color: #333;
	font-weight: 500;
}

.form-table td {
	padding: 8px 0;
}

.form-table input.regular-text,
.form-table textarea,
.form-table select {
	width: 100%;
	box-sizing: border-box;
}

.description {
	color: #555;
	font-size: 13px;
	margin-top: 4px;
}

/* ============================================================
   4. Tabellenbereiche (rechte Spalte)
   ============================================================ */
.mietp-cf-table-gruppe,
.mietp-cf-table-felder,
.mietp-cf-table-werte {
	flex: 1;
	min-width: 70%;
}

.widefat th,
.widefat td {
	padding: 8px 10px;
	vertical-align: top;
}

.widefat th {
	font-weight: 600;
	color: #333;
	background: #f8f9fa;
	border-bottom: 1px solid #ddd;
}

.widefat td {
	border-bottom: 1px solid #eee;
}

.widefat td:first-child,
.widefat th:first-child {
	text-align: left;
	width: 50px;
}

.active-row {
	background: #fff9e6 !important;
	box-shadow: inset 0 0 0 1px #facc15;
	transition: background 0.3s ease;
}

/* ============================================================
   5. Spaltenbreiten (nach Tab getrennt)
   ============================================================ */

/* Tab: Gruppe */
.mietp-cf-table-gruppe th:nth-child(1),
.mietp-cf-table-gruppe td:nth-child(1) {
	width: 40px;
	text-align: center;
}

.mietp-cf-table-gruppe th:nth-child(2),
.mietp-cf-table-gruppe td:nth-child(2) {
	width: 35%;
}

.mietp-cf-table-gruppe th:nth-child(3),
.mietp-cf-table-gruppe td:nth-child(3) {
	width: 55%;
}

.mietp-cf-table-gruppe th:nth-child(4),
.mietp-cf-table-gruppe td:nth-child(4) {
	width: 10%;
	text-align: center;
}

/* Tab: Felder */
.mietp-cf-table-felder th:nth-child(1),
.mietp-cf-table-felder td:nth-child(1) {
	width: 40px;
	text-align: center;
}

.mietp-cf-table-felder th:nth-child(2),
.mietp-cf-table-felder td:nth-child(2) {
	width: 25%;
}

.mietp-cf-table-felder th:nth-child(3),
.mietp-cf-table-felder td:nth-child(3) {
	width: 30%;
}

.mietp-cf-table-felder th:nth-child(4),
.mietp-cf-table-felder td:nth-child(4) {
	width: 15%;
	text-align: center;
}

.mietp-cf-table-felder th:nth-child(5),
.mietp-cf-table-felder td:nth-child(5) {
	width: 10%;
	text-align: center;
}

.mietp-cf-table-felder th:nth-child(6),
.mietp-cf-table-felder td:nth-child(6) {
	width: 10%;
	text-align: center;
}

/* Tab: Werte */
.mietp-cf-table-werte th:nth-child(1),
.mietp-cf-table-werte td:nth-child(1) {
	width: 20px;
	text-align: center;
}

.mietp-cf-table-werte th:nth-child(2),
.mietp-cf-table-werte td:nth-child(2) {
	width: 30%;
}

.mietp-cf-table-werte th:nth-child(3),
.mietp-cf-table-werte td:nth-child(3) {
	width: 55%;
}

.mietp-cf-table-werte th:nth-child(4),
.mietp-cf-table-werte td:nth-child(4) {
	width: 10%;
}

.mietp-cf-table-werte th:nth-child(5),
.mietp-cf-table-werte td:nth-child(5) {
	width: 55%;
}

.mietp-cf-table-werte th:nth-child(6),
.mietp-cf-table-werte td:nth-child(6) {
	width: 10%;
	text-align: center;
}

/* ============================================================
   6. Aktionsbuttons (Bearbeiten / Löschen)
   ============================================================ */
.mietp-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.mietp-action-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #f8f8f8;
	color: #444;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
	font-size: 16px;
	line-height: 1;
}

.mietp-action-icon:hover {
	background: #e9ecef;
	color: #000;
	border-color: #bbb;
}

.mietp-action-icon:active {
	transform: scale(0.96);
}

/* ============================================================
   7. Formular-Buttons (Speichern / Abbrechen)
   ============================================================ */
.button-primary {
	background-color: #2563eb !important;
	border-color: #1d4ed8 !important;
	color: #fff !important;
}
.button-primary:hover {
	background-color: #1d4ed8 !important;
}

.mietp-button-row {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-top: 10px;
}

.mietp-button-row .button-secondary {
	background: #f6f7f7 !important;
	border: 1px solid #ccc !important;
	color: #1d2327 !important;
	box-shadow: 0 1px 0 #ccc !important;
	padding: 0 12px 1px !important;
	border-radius: 4px !important;
	transition: all 0.2s ease !important;
}

.mietp-button-row .button-secondary:hover {
	background: #f0f0f0 !important;
	border-color: #999 !important;
	color: #000 !important;
}

/* ============================================================
   8. Checkboxen & Massenaktionen
   ============================================================ */
input.row-select {
	transform: scale(1.1);
	cursor: pointer;
}

/* ============================================================
   9. Kategorie-Auswahl & Buttons (Tab "Gruppen")
   ============================================================ */
#category_search {
	width: 100%;
	padding: 6px 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	margin-bottom: 6px;
	box-sizing: border-box;
}

#category_list {
	list-style: none;
	margin: 0;
	padding: 6px;
}

#category_list li {
	padding: 4px 6px;
	cursor: pointer;
	transition: background 0.15s ease;
}

#category_list li:hover {
	background: #f0f0f0;
}

#selected-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

#selected-categories .pill {
	background: #e1ecf4;
	border: 1px solid #a7c7e7;
	color: #0366d6;
	border-radius: 16px;
	padding: 3px 8px;
	font-size: 12px;
	display: inline-flex;
	align-items: center;
}

#selected-categories .pill .remove {
	margin-left: 6px;
	cursor: pointer;
	color: #444;
	font-weight: bold;
}

#selected-categories .pill .remove:hover {
	color: #d63638;
}

/* ============================================================
   10. Einheitliches Styling: "Alle hinzufügen" / "Alle löschen"
   ============================================================ */
#category_button_row {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	margin-top: 8px;
}

#category_button_row .button {
	background: #f6f7f7;
	border: 1px solid #c3c4c7;
	color: #1d2327;
	box-shadow: 0 1px 0 #c3c4c7;
	padding: 5px 12px;
	font-size: 13px;
	line-height: 1.4;
	height: 30px;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.15s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

#category_button_row .button:hover {
	background: #f0f0f1;
	border-color: #8c8f94;
	color: #000;
}

#category_button_row .button:active {
	background: #e4e4e4;
	border-color: #8c8f94;
	box-shadow: none;
	transform: translateY(1px);
}
