@charset "UTF-8";

.htc-status-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 90px;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
}

.htc-status-badge.is-completed {
	background: #e7f6ee;
	color: #1e7d3a;
	border: 1px solid #bfe7cd;
}

.htc-status-badge.is-pending {
	background: #fff7e6;
	color: #8a5a00;
	border: 1px solid #ffd89a;
}

/* ===== Judge rows (admin-contest-meta.php) ===== */

.htc-judge-row.is-selected {
	background: #f0f6fc;
}

.htc-judge-row.is-completed .htc-status-badge {
	opacity: 1;
}

.htc-judge-row.is-pending .htc-status-badge {
	opacity: 1;
}

.htc-judge-row.is-completed td {
	opacity: 0.95;
}

/* ===== Status badge icons ===== */

.htc-status-badge::before {
	display: inline-block;
	margin-right: 6px;
	font-size: 11px;
	line-height: 1;
}

.htc-status-badge.is-completed::before { content: "✓"; }
.htc-status-badge.is-pending::before { content: "…"; }
.htc-status-badge.is-open::before { content: "●"; }
.htc-status-badge.is-judging::before { content: "⏳"; }
.htc-status-badge.is-closed::before { content: "✓"; }

/* ===== Badge transitions ===== */

.htc-status-badge {
	transition:
		background-color 180ms ease,
		color 180ms ease,
		border-color 180ms ease,
		transform 120ms ease;
}

.htc-status-badge.is-updating {
	transform: scale(1.05);
}

@media (prefers-reduced-motion: reduce) {
	.htc-status-badge { transition: none; }
}

.htc-mb-6 { margin-bottom: 6px; }


/* =========================================
   ENTRY FORM (Public Submission)
========================================= */

.htc-entry-form {
	max-width: 640px;
	margin: 2rem auto;
	padding: 24px;
	background: #f3e6c8;
	border-radius: 18px;
	box-shadow: 0 10px 28px rgba(0,0,0,.12);
}

/* Form layout reset */
.htc-entry-form form {
	display: grid;
	grid-template-columns: 1fr;
	gap: 18px;
}

/* Labels */
.htc-entry-form label {
	font-weight: 700;
	color: #3b2f1d;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* Inputs + textarea */
.htc-entry-form input[type="text"],
.htc-entry-form input[type="email"],
.htc-entry-form textarea {
	border: 1px solid #d9c79a;
	border-radius: 10px;
	padding: 12px 14px;
	font-size: .95rem;
	background: #fff;
	color: #3b2f1d;
	box-shadow: inset 0 1px 3px rgba(0,0,0,.08);
}

.htc-entry-form textarea {
	resize: vertical;
	min-height: 120px;
	line-height: 1.4;
}

/* Focus state */
.htc-entry-form input:focus,
.htc-entry-form textarea:focus {
	outline: none;
	border-color: #5e6c40;
	box-shadow: 0 0 0 3px rgba(94,108,64,.25);
}

/* File input */
.htc-entry-form input[type="file"] {
	font-size: .9rem;
	color: #3b2f1d;
}

/* Submit button (match everything else) */
.htc-entry-form button[type="submit"] {
	align-self: center;

	min-width: 220px;
	padding: 12px 18px;
	border-radius: 6px;
	border: none;

	background: #5e6c40;
	color: #ffffff;

	font-weight: 800;
	font-size: 1rem;
	cursor: pointer;

	box-shadow: 0 4px 12px rgba(0,0,0,.18);
	transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.htc-entry-form button[type="submit"]:hover {
	background: #944039;
	transform: translateY(-1px);
	box-shadow: 0 10px 18px rgba(0,0,0,.22);
	filter: brightness(1.05);
}

.htc-entry-form button[type="submit"]:active {
	transform: translateY(0);
	box-shadow: 0 6px 12px rgba(0,0,0,.16);
	filter: brightness(.98);
}

/* =========================================
   Optional: Tighten spacing on mobile
========================================= */
@media (max-width: 600px) {
	.htc-entry-form {
		padding: 18px;
	}
}

/* =========================================
   keeps minimum height so foot doesn't touch content
========================================= */
.entry-content {
    min-height:400px;
}

/* =========================================
   These are errant inline styling fixes
========================================= */

.htc-admin-list {
  margin-left: 16px;
}

.htc-button-danger {
  color: #a00;
}

.htc-entry-title {
  width: 100%;
  max-width: 520px;
}

.htc-danger-text {
  color: #a00;
  font-weight: 700;
}

/* =========================================
   Judges Meta Box – RESPONSIVE STACKED VIEW
   (No horizontal scroll, sane mobile UX)
========================================= */

.htc-judges-table {
	width: 100%;
	border-collapse: collapse;
}

/* Desktop: normal table */
.htc-judges-table th,
.htc-judges-table td {
	vertical-align: top;
}

/* Inputs behave */
.htc-judges-table input[type="text"],
.htc-judges-table input[type="email"] {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* ================================
   Mobile: stack rows as cards
================================ */
@media (max-width: 850px) {

	.htc-judges-table thead {
		display: none;
	}

	.htc-judges-table,
	.htc-judges-table tbody,
	.htc-judges-table tr {
		display: block;
		width: 100%;
	}

	.htc-judges-table tr {
		background: #fff;
		border: 1px solid #ccd0d4;
		border-radius: 6px;
		padding: 10px;
		margin-bottom: 14px;
	}

	.htc-judges-table td {
		display: grid;
		grid-template-columns: 120px 1fr;
		gap: 8px;
		padding: 6px 0;
		border: none;
	}

	.htc-judges-table td::before {
		content: attr(data-label);
		font-weight: 600;
		color: #555;
	}

	.htc-status-badge {
		justify-self: flex-start;
	}
}

/* =========================================
   FINAL MOBILE FIX – Judges table (<850px)
========================================= */

@media (max-width: 850px) {

	/* Kill widefat table width inheritance */
	#htc_contest_judges table.widefat {
		width: 100%;
		max-width: 100%;
		min-width: 0;
		table-layout: fixed;
		border: none;
	}

	/* Ensure rows never exceed container */
	#htc_contest_judges tr.htc-judge-row {
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
	}

	/* Force cells to respect container width */
	#htc_contest_judges tr.htc-judge-row > td {
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
		overflow-wrap: anywhere;
	}

	/* Inputs must never force width */
	#htc_contest_judges input.regular-text {
		width: 100%;
		max-width: 100%;
	}

	/* Prevent judge link/status from stretching row */
	#htc_contest_judges .htc-mb-6,
	#htc_contest_judges .htc-status-badge {
		max-width: 100%;
	}
}

/* Fixes short pages */
#content-area .et_pb_section {
    padding:0;
}

#main-content .container {
    min-height:450px;
}

.htc-back-link {
	margin-bottom: 1rem;
}

.htc-add-judge-form input {
	width: 100%;
	max-width: 320px;
}

.htc-judge-actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.htc-admin-controls .htc-note {
    display: block;
    clear: both;
    margin-top: 10px;
}

.et_pb_title_container .et_pb_title_meta_container {
    display: none;
}
