/* ========================================================================== 
   WP Helpdesk – Customer-facing frontend styles
   ========================================================================== */

.hd-wrap {
	max-width: 900px;
	margin: 40px auto;
	padding: 0 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	color: #1d2327;
}

/* Page title */
.hd-title {
	font-size: 1.75rem;
	font-weight: 700;
	margin: 0 0 8px;
	text-align: center;
}

.hd-subtitle {
	color: #646970;
	margin: 0 0 32px;
}

/* Back link */
.hd-back-link {
	margin: 0 0 24px;
	font-size: 0.9rem;
}

.hd-back-link a {
	color: #0073aa;
	text-decoration: none;
}

.hd-back-link a:hover {
	text-decoration: underline;
}

/* Action buttons on landing page */
.hd-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 24px;
}

/* Customer hub action grid (kept for backward compatibility) */
.hd-action-grid {
	list-style: none;
	padding: 0;
	margin: 24px 0 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 14px;
}

.hd-action-card {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.hd-action-card__title {
	margin: 0;
	font-size: 1.05rem;
}

.hd-action-card__description {
	margin: 0;
	color: #646970;
	font-size: 0.92rem;
	line-height: 1.45;
}

/* Centered navigation menu on the Help Desk landing page */
.hd-wrap .hd-nav-menu {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	margin: 40px auto 0;
	max-width: 36rem;
	width: 100%;
}

.hd-wrap .hd-nav-menu__item,
.hd-wrap .hd-nav-menu a.hd-nav-menu__item {
	display: block !important;
	width: 100%;
	margin: 0 auto;
	padding: 18px 28px;
	font-size: 1.4rem !important;
	line-height: 1.35;
	font-weight: 600;
	text-align: center;
	text-decoration: none !important;
	background: #f6f7f7;
	color: #1d2327;
	border: 1px solid #dcdcde;
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.hd-wrap .hd-nav-menu a.hd-nav-menu__item:hover,
.hd-wrap .hd-nav-menu__item:hover {
	background: #fff;
	border-color: #8c8f94;
	color: #1d2327;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
	transform: translateY(-1px);
}

.hd-wrap .hd-nav-menu a.hd-nav-menu__item:focus,
.hd-wrap .hd-nav-menu a.hd-nav-menu__item:focus-visible,
.hd-wrap .hd-nav-menu__item:focus,
.hd-wrap .hd-nav-menu__item:focus-visible {
	background: #fff;
	border-color: #0073aa;
	color: #1d2327;
	outline: 2px solid #0073aa;
	outline-offset: 2px;
	box-shadow: 0 0 0 4px rgba(0, 115, 170, 0.15);
}

/* Buttons */
.hd-btn {
	display: inline-block;
	padding: 10px 22px;
	font-size: 0.95rem;
	font-weight: 600;
	border-radius: 4px;
	border: none;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.hd-btn--primary {
	background: #0073aa;
	color: #fff;
}

.hd-btn--primary:hover:not(:disabled) {
	background: #005177;
	color: #fff;
}

.hd-btn--secondary {
	background: #f0f0f1;
	color: #1d2327;
}

.hd-btn--secondary:hover:not(:disabled) {
	background: #dcdcde;
}

.hd-btn:disabled,
.hd-btn[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Step indicator */
.hd-steps {
	display: flex;
	gap: 0;
	margin: 0 0 32px;
	border-bottom: 2px solid #dcdcde;
	padding-bottom: 12px;
}

.hd-step {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 20px 0 0;
	color: #8c8f94;
	font-size: 0.85rem;
}

.hd-step__number {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #dcdcde;
	color: #646970;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.8rem;
}

.hd-step--active .hd-step__number {
	background: #0073aa;
	color: #fff;
}

.hd-step--active .hd-step__label {
	color: #0073aa;
	font-weight: 600;
}

.hd-step--done .hd-step__number {
	background: #00a32a;
	color: #fff;
}

/* Form structure */
.hd-form-container {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 28px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.hd-form-step__title {
	font-size: 1.1rem;
	font-weight: 600;
	margin: 0 0 24px;
}

.hd-form-step--hidden {
	display: none;
}

/* Form fields */
.hd-field {
	margin-bottom: 20px;
}

.hd-label {
	display: block;
	font-weight: 600;
	font-size: 0.9rem;
	margin-bottom: 6px;
}

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

.hd-input,
.hd-select,
.hd-textarea {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	font-size: 0.95rem;
	color: #1d2327;
	background: #fff;
	box-sizing: border-box;
	transition: border-color 0.1s ease, box-shadow 0.1s ease;
}

.hd-input:focus,
.hd-select:focus,
.hd-textarea:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.25);
}

.hd-input[readonly],
.hd-textarea[readonly] {
	background: #f6f7f7;
	cursor: default;
}

.hd-textarea {
	resize: vertical;
	min-height: 120px;
}

.hd-field-hint {
	margin: 6px 0 0;
	font-size: 0.85rem;
	color: #646970;
	min-height: 1.2em;
}

.hd-file-input {
	display: block;
	margin-top: 4px;
	max-width: 100%;
}

.hd-file-picker {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.hd-file-picker__input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

.hd-file-picker__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.hd-file-picker__button {
	cursor: pointer;
}

.hd-file-picker__selection {
	font-size: 0.9rem;
	color: #1d2327;
	word-break: break-word;
}

.hd-file-picker__input:focus + .hd-file-picker__controls .hd-file-picker__button,
.hd-file-picker__input:focus-visible + .hd-file-picker__controls .hd-file-picker__button {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* Form actions */
.hd-form-actions {
	margin-top: 24px;
}

.hd-form-actions--split {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* Error message */
.hd-error-message {
	color: #d63638;
	font-size: 0.9rem;
	margin-top: 12px;
	min-height: 1.2em;
}

/* Confirmation */
.hd-confirmation {
	text-align: center;
	padding: 20px 0;
}

.hd-confirmation__icon {
	font-size: 3rem;
	color: #00a32a;
	margin-bottom: 12px;
}

.hd-confirmation__title {
	font-size: 1.3rem;
	font-weight: 700;
	margin: 0 0 12px;
}

.hd-confirmation__message {
	color: #646970;
	margin: 0 0 24px;
}

/* Topic description summary (shown in step 1 above the detail fields) */
.hd-topic-description-summary {
	background: #f6f7f7;
	border-left: 4px solid #0073aa;
	border-radius: 2px;
	padding: 12px 16px;
	margin-bottom: 24px;
	font-size: 0.9rem;
	color: #3c434a;
}

.hd-topic-description-summary:empty {
	display: none;
}

.hd-topic-description-summary__label {
	font-weight: 600;
	margin-bottom: 4px;
}

.hd-topic-description-summary__text {
	margin: 0;
}

/* Start over / change topic action */
.hd-start-over {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: none;
	border: none;
	cursor: pointer;
	color: #646970;
	font-size: 0.85rem;
	padding: 0;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.hd-start-over:hover,
.hd-start-over:focus {
	color: #d63638;
	outline: 2px solid #d63638;
	outline-offset: 2px;
}

.hd-form-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}

/* -------------------------------------------------------------------------
 * Attachment gallery
 * ---------------------------------------------------------------------- */

.hd-attachments {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 16px 0;
}

.hd-attachment {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 10px;
	max-width: 280px;
	width: 100%;
}

.hd-attachment--image {
	flex-direction: column;
	align-items: center;
}

.hd-attachment__thumb-btn {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	display: block;
	border-radius: 4px;
	overflow: hidden;
}

.hd-attachment__thumb-btn:focus {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.hd-attachment__thumb {
	display: block;
	width: 100%;
	max-width: 240px;
	height: 140px;
	object-fit: cover;
	border-radius: 4px;
}

.hd-attachment__icon {
	font-size: 2rem;
	line-height: 1;
	flex-shrink: 0;
}

.hd-attachment__info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	width: 100%;
}

.hd-attachment__name {
	font-weight: 600;
	font-size: 0.875rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hd-attachment__meta {
	font-size: 0.8rem;
	color: #646970;
}

.hd-attachment__actions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-top: 4px;
}

.hd-btn--xs {
	font-size: 0.78rem;
	padding: 3px 8px;
}

/* -------------------------------------------------------------------------
 * Lightbox / modal
 * ---------------------------------------------------------------------- */

.hd-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hd-lightbox[hidden] {
	display: none;
}

.hd-lightbox__img {
	max-width: 90vw;
	max-height: 90vh;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 4px 32px rgba(0, 0, 0, 0.6);
}

.hd-lightbox__close {
	position: absolute;
	top: 16px;
	right: 20px;
	background: none;
	border: none;
	color: #fff;
	font-size: 2rem;
	cursor: pointer;
	line-height: 1;
	padding: 0;
}

.hd-lightbox__close:hover,
.hd-lightbox__close:focus {
	color: #f0f0f1;
	outline: 2px solid #f0f0f1;
	outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * Guest ticket view
 * ---------------------------------------------------------------------- */

.hd-ticket-view {
	max-width: 760px;
}

.hd-ticket-meta {
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 12px 16px;
	margin-bottom: 20px;
}

.hd-ticket-meta p {
	margin: 4px 0;
}

.hd-status-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 0.8rem;
	background: #dcdcde;
	color: #1d2327;
}

.hd-section-title {
	font-size: 1.05rem;
	margin-top: 28px;
	margin-bottom: 12px;
	border-bottom: 1px solid #dcdcde;
	padding-bottom: 6px;
}

.hd-thread {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.hd-thread__message {
	padding: 12px 16px;
	border-radius: 4px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
}

.hd-thread__message--agent {
	background: #f0f6fc;
	border-color: #c3d9f5;
}

.hd-thread__meta {
	display: flex;
	gap: 12px;
	font-size: 0.8rem;
	color: #646970;
	margin-bottom: 6px;
}

.hd-thread__author {
	font-weight: 600;
	text-transform: capitalize;
}

.hd-thread__body > *:last-child {
	margin-bottom: 0;
}

.hd-reply-form {
	max-width: 560px;
	margin-top: 12px;
}

.hd-success-message--hidden {
	display: none;
}

.hd-success-message {
	color: #00a32a;
	font-size: 0.9rem;
	margin-top: 8px;
}

/* -------------------------------------------------------------------------
 * Responsive
 * ---------------------------------------------------------------------- */

@media (max-width: 600px) {
	.hd-attachments {
		flex-direction: column;
	}

	.hd-attachment {
		max-width: 100%;
	}

	.hd-attachment__thumb {
		max-width: 100%;
	}
}
