/**
 * Salon Jobs Widget Styles
 * Version: 1.0.0
 *
 * Specificity strategy:
 *  - Card elements use .sj-wrapper .sj-class (0,2,0) to beat theme selectors like
 *    "button" (0,0,1) or ".theme button" (0,1,1).
 *  - Elementor dynamic CSS outputs ".elementor-element-ID .sj-class" (0,2,0) with
 *    the same specificity but loads AFTER this file, so it wins by cascade order.
 *  - !important is only used on modal utility buttons (×, Submit, Close) which have
 *    no Elementor color controls and must always beat the theme.
 */

/* ==============================================
   BASE
   ============================================== */
.sj-wrapper *,
.sj-wrapper *::before,
.sj-wrapper *::after {
	box-sizing: border-box;
}

.sj-wrapper {
	position: relative;
	width: 100%;
}

.sj-empty {
	text-align: center;
	padding: 60px 20px;
	color: #999;
	font-style: italic;
}

/* ==============================================
   GRID
   ============================================== */
.sj-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 30px;
	width: 100%;
}

/* ==============================================
   CARD
   ============================================== */
.sj-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #eee;
	overflow: hidden;
	transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.sj-card:hover {
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
	transform: translateY(-4px);
}

/* ==============================================
   IMAGE
   ============================================== */
.sj-image {
	overflow: hidden;
	flex-shrink: 0;
	background: #f5f5f5;
}

.sj-image img {
	display: block;
	width: 100%;
	height: 240px;
	object-fit: cover;
	object-position: center;
	transition: transform 0.4s ease;
}

.sj-card:hover .sj-image img {
	transform: scale(1.04);
}

/* ==============================================
   CARD CONTENT
   ============================================== */
.sj-content {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 24px;
}

/* ==============================================
   BADGES
   — Elementor controls: fulltime_badge_bg, fulltime_badge_color,
     parttime_badge_bg, parttime_badge_color
   — No !important needed; Elementor's (0,2,0) selector beats our (0,2,0)
     by cascade order (Elementor's <style> loads after this file).
   ============================================== */
.sj-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 14px;
}

/* Reset any theme styles on <span> tags */
.sj-wrapper .sj-badge {
	display: inline-block;
	padding: 4px 12px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	border-radius: 2px;
	line-height: 1.6;
	border: none;
	box-shadow: none;
}

.sj-wrapper .sj-badge--full-time {
	background-color: #990000;
	color: #fff;
}

.sj-wrapper .sj-badge--part-time {
	background-color: #f1f1f1;
	color: #333;
}

/* ==============================================
   TITLE
   ============================================== */
.sj-title {
	margin: 0 0 12px 0;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	color: #333;
}

/* ==============================================
   DESCRIPTION
   ============================================== */
.sj-description {
	margin: 0 0 16px 0;
	font-size: 14px;
	line-height: 1.65;
	color: #555;
	flex: 1;
}

/* ==============================================
   SALARY
   ============================================== */
.sj-salary {
	margin: 0 0 20px 0;
	font-size: 14px;
	font-weight: 600;
	color: #990000;
}

/* ==============================================
   APPLY BUTTON  (card CTA)
   — Elementor controls: button_bg, button_color, button_hover_bg
   — Use (0,2,0) specificity to beat theme; NO !important so Elementor wins.
   ============================================== */
.sj-wrapper .sj-apply-btn {
	display: block;
	width: 100%;
	margin-top: auto;
	padding: 13px 20px;
	background-color: #990000;
	background-image: none;   /* reset theme gradients */
	color: #fff;
	border: none;
	border-radius: 2px;
	box-shadow: none;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	cursor: pointer;
	transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.sj-wrapper .sj-apply-btn:hover {
	background-color: #770000;
	background-image: none;
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 3px 10px rgba(153, 0, 0, 0.3);
}

.sj-wrapper .sj-apply-btn:focus-visible {
	outline: 3px solid #990000;
	outline-offset: 2px;
}

/* ==============================================
   MODAL OVERLAY
   ============================================== */
.sj-modal {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	z-index: 99999;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.sj-modal.is-open {
	display: flex;
}

/* ==============================================
   MODAL INNER CARD
   ============================================== */
.sj-modal-inner {
	background: #fff;
	width: 100%;
	max-width: 560px;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
	padding: 40px;
	border-radius: 4px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	animation: sj-modal-in 0.25s ease;
}

@keyframes sj-modal-in {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ==============================================
   MODAL CLOSE BUTTON  (×)
   — No Elementor controls → !important is safe and needed to beat theme pink.
   ============================================== */
.sj-modal .sj-modal-close {
	position: absolute !important;
	top: 14px !important;
	right: 18px !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: none !important;
	box-shadow: none !important;
	font-size: 26px !important;
	line-height: 1 !important;
	cursor: pointer !important;
	color: #999 !important;
	padding: 4px !important;
	border-radius: 0 !important;
	transition: color 0.2s;
}

.sj-modal .sj-modal-close:hover {
	background: transparent !important;
	background-color: transparent !important;
	color: #333 !important;
}

.sj-modal-title {
	margin: 0 0 24px 0;
	font-size: 22px;
	font-weight: 700;
	color: #333;
	line-height: 1.3;
	padding-right: 30px;
}

/* ==============================================
   FORM
   ============================================== */
.sj-form-group {
	margin-bottom: 18px;
}

.sj-form-group label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #333;
}

.sj-form-group label span {
	color: #990000;
	margin-left: 2px;
}

.sj-modal .sj-form-group input,
.sj-modal .sj-form-group select {
	display: block !important;
	width: 100% !important;
	padding: 10px 14px !important;
	border: 1px solid #ddd !important;
	border-radius: 2px !important;
	font-size: 14px !important;
	color: #333 !important;
	background-color: #fff !important;
	background-image: none !important;
	box-shadow: none !important;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	appearance: none;
	-webkit-appearance: none;
}

.sj-modal .sj-form-group select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 14px center !important;
	padding-right: 36px !important;
}

.sj-modal .sj-form-group input:focus,
.sj-modal .sj-form-group select:focus {
	outline: none !important;
	border-color: #990000 !important;
	box-shadow: 0 0 0 3px rgba(153, 0, 0, 0.1) !important;
}

.sj-modal .sj-form-group input::placeholder {
	color: #aaa;
}

/* ==============================================
   SUBMIT BUTTON
   — No Elementor controls → !important is safe and needed to beat theme pink.
   ============================================== */
.sj-modal .sj-submit-btn {
	display: block !important;
	width: 100% !important;
	margin-top: 8px !important;
	padding: 14px 20px !important;
	background-color: #875E4B !important;
	background-image: none !important;
	color: #fff !important;
	border: none !important;
	border-radius: 2px !important;
	box-shadow: none !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	text-transform: uppercase !important;
	letter-spacing: 1px !important;
	cursor: pointer !important;
	transition: background-color 0.2s ease, opacity 0.2s ease;
}

.sj-modal .sj-submit-btn:hover:not(:disabled) {
	background-color: #6b4a39 !important;
	background-image: none !important;
	color: #fff !important;
}

.sj-modal .sj-submit-btn:disabled {
	opacity: 0.6 !important;
	cursor: not-allowed !important;
}

/* ==============================================
   ERROR / SUCCESS MESSAGES
   ============================================== */
.sj-error-msg {
	display: none;
	margin-top: 12px;
	padding: 10px 14px;
	background: #fff5f5;
	border: 1px solid #fcc;
	border-radius: 2px;
	color: #c00;
	font-size: 13px;
	text-align: center;
}

.sj-error-msg.is-visible {
	display: block;
}

.sj-success-msg {
	display: none;
	text-align: center;
	padding: 40px 20px;
}

.sj-success-msg.is-visible {
	display: block;
}

.sj-success-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	background: #990000;
	color: #fff;
	border-radius: 50%;
	font-size: 28px;
	margin: 0 auto 20px auto;
}

.sj-success-msg h3 {
	margin: 0 0 10px 0;
	font-size: 22px;
	font-weight: 700;
	color: #333;
}

.sj-success-msg p {
	margin: 0 0 24px 0;
	font-size: 15px;
	color: #555;
}

/* Close button on success screen — no Elementor controls, !important safe */
.sj-modal .sj-close-success {
	padding: 12px 30px !important;
	background-color: #f1f1f1 !important;
	background-image: none !important;
	color: #333 !important;
	border: none !important;
	border-radius: 2px !important;
	box-shadow: none !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	transition: background-color 0.2s ease;
}

.sj-modal .sj-close-success:hover {
	background-color: #e0e0e0 !important;
	color: #333 !important;
}

/* ==============================================
   RESPONSIVE — TABLET
   ============================================== */
@media (max-width: 1024px) {
	.sj-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 24px;
	}

	.sj-content {
		padding: 20px;
	}

	.sj-title {
		font-size: 18px;
	}
}

/* ==============================================
   RESPONSIVE — MOBILE
   ============================================== */
@media (max-width: 768px) {
	.sj-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.sj-image img {
		height: 200px;
	}

	.sj-modal-inner {
		padding: 28px 20px;
	}

	.sj-modal-title {
		font-size: 18px;
		margin-bottom: 18px;
	}
}

/* ==============================================
   RESPONSIVE — SMALL MOBILE
   ============================================== */
@media (max-width: 480px) {
	.sj-content {
		padding: 16px;
	}

	.sj-title {
		font-size: 17px;
	}

	.sj-image img {
		height: 180px;
	}
}

/* ==============================================
   ACCESSIBILITY
   ============================================== */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

/* ==============================================
   ELEMENTOR EDITOR
   ============================================== */
.elementor-editor-active .sj-wrapper {
	min-height: 200px;
}

.elementor-editor-active .sj-modal {
	display: none !important;
}
