/**
 * PsychDirect Global UI Polish
 * 
 * Final refinement pass: typography, spacing, focus states, and micro-UX improvements.
 * Non-destructive - layered on top of existing styles.
 */

/* ==========================================================================
   1. GLOBAL TYPOGRAPHY & FONT ENFORCEMENT
   Ensure Inter is applied everywhere, override any legacy fonts
   ========================================================================== */

/* Universal Inter enforcement */
body,
body *,
.woocommerce *,
.woocommerce-page *,
.select2-container *,
.modal *,
.dropdown-menu * {
	font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Override any remaining Montserrat fallbacks */
[style*="Montserrat"],
[style*="montserrat"] {
	font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* Comfortable line-height for body copy */
body {
	line-height: 1.6;
}

p, li, td, th, label, span, div {
	line-height: inherit;
}

/* ==========================================================================
   2. HEADER & NAVIGATION POLISH
   ========================================================================== */

/* Desktop dropdowns: better alignment and spacing */
@media (min-width: 992px) {
	body:not(.home) .site-header .navbar-nav .sub-menu {
		min-width: 200px;
		padding: 8px;
	}

	body:not(.home) .site-header .navbar-nav .sub-menu li {
		margin: 0;
	}

	body:not(.home) .site-header .navbar-nav .sub-menu a {
		padding: 10px 14px;
		font-size: 14px;
		border-radius: 8px;
	}

	/* Improved hover/focus states */
	body:not(.home) .site-header .navbar-nav .sub-menu a:hover,
	body:not(.home) .site-header .navbar-nav .sub-menu a:focus-visible {
		background: #f1f5f9;
		color: #1e293b;
		outline: none;
	}

	/* Logout item styling - softer */
	body:not(.home) .site-header .navbar-nav .sub-menu li.pd-nav-logout {
		margin-top: 6px;
		padding-top: 6px;
	}

	body:not(.home) .site-header .navbar-nav .sub-menu li.pd-nav-logout a {
		color: #64748b;
		font-size: 13px;
	}
}

/* Mobile: ensure tap targets are accessible (min 44px) */
@media (max-width: 991px) {
	body:not(.home) .site-header .navbar-nav > li > a {
		min-height: 44px;
		display: flex;
		align-items: center;
		padding: 12px 16px;
	}

	body:not(.home) .site-header .navbar-nav .sub-menu a {
		min-height: 44px;
		display: flex;
		align-items: center;
		padding: 12px 16px;
	}
}

/* Header visual weight - keep lighter than content */
body:not(.home) .site-header {
	background: #ffffff;
}

body:not(.home) .site-header .navbar {
	background: transparent !important;
}

/* ==========================================================================
   3. GLOBAL FOCUS STATES (Accessibility)
   ========================================================================== */

/* Visible focus for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid #3b82f6;
	outline-offset: 2px;
	border-radius: 4px;
}

/* Remove default focus outline when using focus-visible */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
	outline: none;
}

/* Ensure buttons look clickable */
button,
.btn,
[role="button"],
input[type="submit"],
input[type="button"] {
	cursor: pointer;
}

button:disabled,
.btn:disabled,
input:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

/* ==========================================================================
   4. FORMS & INPUTS POLISH
   ========================================================================== */

/* Input focus states */
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
	outline: none;
}

/* Labels should be clear */
label {
	font-weight: 500;
	color: #374151;
	margin-bottom: 6px;
	display: block;
}

/* Form error states - calm but clear */
.woocommerce-error,
.form-error,
.error-message,
.field-error {
	color: #dc2626;
	font-size: 13px;
	margin-top: 4px;
}

/* Success states - calm green */
.woocommerce-message,
.form-success,
.success-message {
	color: #059669;
}

/* ==========================================================================
   5. SEARCH & FILTER REFINEMENTS
   ========================================================================== */

/* Filter pills: even spacing */
body.page-advance-search #specialize-container {
	gap: 10px;
}

body.page-advance-search #specialize-container a.btnstyle {
	padding: 8px 12px;
	font-size: 13px;
	font-weight: 500;
}

/* Active vs inactive filter distinction */
body.page-advance-search .filter-active,
body.page-advance-search .facetwp-facet .facetwp-checkbox.checked {
	background: #3b82f6;
	color: #ffffff;
}

/* ==========================================================================
   6. LISTING CARDS REFINEMENTS
   ========================================================================== */

/* Card consistency */
.pd-card {
	transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.pd-card:hover {
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* Name readability */
.pd-card__title,
.pd-card .listing-name,
.job_listing h3,
.job_listing .company-name {
	font-size: 17px;
	font-weight: 600;
	color: #0f172a;
	line-height: 1.35;
}

/* Role/subtitle - de-emphasized */
.pd-card .listing-role,
.job_listing .job-type {
	font-size: 14px;
	color: #64748b;
	font-weight: 400;
}

/* Tags - consistent sizing */
.pd-card .listing-tags,
.job_listing .listing-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.pd-card .listing-tag,
.job_listing .listing-tag {
	font-size: 12px;
	padding: 4px 10px;
	border-radius: 100px;
	background: #f1f5f9;
	color: #475569;
}

/* "See full profile" links - clear but not dominant */
.pd-card .view-profile-link,
.job_listing .view-listing-link {
	font-size: 14px;
	font-weight: 500;
	color: #3b82f6;
	text-decoration: none;
}

.pd-card .view-profile-link:hover,
.job_listing .view-listing-link:hover {
	text-decoration: underline;
}

/* Verified badge - supportive, not dominant */
.verified-badge,
.pd-verified-badge {
	font-size: 11px;
	padding: 3px 8px;
	background: #dcfce7;
	color: #166534;
	border-radius: 100px;
	font-weight: 500;
}

/* ==========================================================================
   7. FOOTER TRANSITION
   ========================================================================== */

/* Global footer transition buffer */
.site-content::after,
main::after {
	content: '';
	display: block;
	height: 60px;
	background: linear-gradient(
		to bottom,
		transparent 0%,
		rgba(6, 6, 104, 0.02) 50%,
		rgba(6, 6, 104, 0.05) 100%
	);
}

/* Footer link tap targets on mobile */
@media (max-width: 768px) {
	.pd-footer__link {
		display: inline-block;
		padding: 8px 0;
		min-height: 44px;
		line-height: 28px;
	}
	
	.pd-footer__links {
		gap: 4px;
	}
}

/* ==========================================================================
   8. WOOCOMMERCE ACCOUNT AREAS POLISH
   ========================================================================== */

/* Section titles - clear hierarchy */
body.woocommerce-account h2,
body.woocommerce-account h3 {
	font-weight: 600;
	color: #1e293b;
	margin-bottom: 16px;
}

/* Secondary text de-emphasized */
body.woocommerce-account .woocommerce-MyAccount-content p {
	color: #475569;
	line-height: 1.65;
}

/* Plain English replacements via CSS (where possible) */
body.woocommerce-account .woocommerce-orders-table__cell-order-status {
	text-transform: capitalize;
}

/* Action buttons - clear and obvious */
body.woocommerce-account .woocommerce-button,
body.woocommerce-account .button {
	font-weight: 500;
	padding: 10px 20px;
	border-radius: 8px;
	transition: background-color 0.15s ease, transform 0.1s ease;
}

body.woocommerce-account .woocommerce-button:hover,
body.woocommerce-account .button:hover {
	transform: translateY(-1px);
}

/* Mobile account pages - prevent cramping */
@media (max-width: 768px) {
	body.woocommerce-account .woocommerce-MyAccount-content {
		padding: 20px 16px;
	}
	
	body.woocommerce-account .woocommerce-table--order-details td {
		padding: 12px 8px;
	}
}

/* ==========================================================================
   9. STRIPE TEST MODE MESSAGING (reduce visual noise)
   ========================================================================== */

.woocommerce-info.wc-stripe-test-mode-notice,
.stripe-test-mode-notice,
[class*="test-mode"] {
	background: #fefce8 !important;
	border-color: #fde047 !important;
	color: #854d0e !important;
	font-size: 13px;
	padding: 10px 14px;
	border-radius: 8px;
}

/* ==========================================================================
   10. EMPTY STATES & EDGE CASES
   ========================================================================== */

/* Empty state messaging */
.woocommerce-info:empty,
.no-results,
.empty-state {
	text-align: center;
	padding: 40px 20px;
	color: #64748b;
}

.no-results::before,
.empty-state::before {
	content: '';
	display: block;
	width: 48px;
	height: 48px;
	margin: 0 auto 16px;
	background: #f1f5f9;
	border-radius: 50%;
}

/* ==========================================================================
   11. CONTRAST IMPROVEMENTS
   ========================================================================== */

/* Ensure sufficient contrast for muted text */
.text-muted,
.text-secondary,
small,
.meta {
	color: #64748b; /* Ensure WCAG AA compliance */
}

/* Links in dark areas */
.site-footer a,
.pd-footer__link {
	color: rgba(255, 255, 255, 0.92);
}

.site-footer a:hover,
.pd-footer__link:hover {
	color: #93c5fd;
}

/* ==========================================================================
   12. SPACING REFINEMENTS
   ========================================================================== */

/* Tighten excessive spacing without crowding */
.site-content {
	padding-top: 0;
}

/* Consistent section spacing */
section + section,
.woocommerce-MyAccount-content > * + * {
	margin-top: 24px;
}

/* Card internal spacing - breathable but not floaty */
.pd-card > * + * {
	margin-top: 12px;
}

/* ==========================================================================
   13. MODALS & OVERLAYS
   ========================================================================== */

/* Ensure modals match site styling */
.modal-content,
.pd-modal {
	font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	border-radius: 16px;
	border: 1px solid #e2e8f0;
	box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
}

.modal-header,
.pd-modal__header {
	border-bottom: 1px solid #f1f5f9;
	padding: 20px 24px;
}

.modal-body,
.pd-modal__body {
	padding: 24px;
}

.modal-footer,
.pd-modal__footer {
	border-top: 1px solid #f1f5f9;
	padding: 16px 24px;
}

/* ==========================================================================
   14. PRINT STYLES (basic cleanup)
   ========================================================================== */

@media print {
	.site-header,
	.site-footer,
	.pd-footer,
	.woocommerce-MyAccount-navigation,
	button,
	.btn {
		display: none !important;
	}
	
	body {
		background: white !important;
		color: black !important;
	}
}
