/* PowerfulWP SMS for WooCommerce — Admin v2 */

/* ── Variables ──────────────────────────────────────────────── */
:root {
	--pwsms-primary: #2271b1;
	--pwsms-primary-light: #f0f6fc;
	--pwsms-primary-dark: #135e96;
	--pwsms-success: #00a32a;
	--pwsms-error: #d63638;
	--pwsms-warning: #dba617;
	--pwsms-grey-100: #f6f7f7;
	--pwsms-grey-200: #f0f0f1;
	--pwsms-grey-300: #dcdcde;
	--pwsms-grey-400: #c3c4c7;
	--pwsms-grey-500: #8c8f94;
	--pwsms-grey-600: #646970;
	--pwsms-grey-700: #50575e;
	--pwsms-grey-900: #1d2327;
	--pwsms-radius: 8px;
	--pwsms-radius-sm: 6px;
	--pwsms-shadow: 0 1px 3px rgba(0,0,0,.06);
	--pwsms-shadow-md: 0 2px 8px rgba(0,0,0,.08);
	--pwsms-transition: .18s ease;
}

/* ── Layout ─────────────────────────────────────────────────── */
.pwsms-wrap {
	max-width: 960px;
	margin: 12px 0 0;
}
.pwsms-screen-title {
	height: 0;
	margin: 0;
	padding: 0;
	overflow: hidden;
	visibility: hidden;
}

/* ── Branded header ─────────────────────────────────────────── */
.pwsms-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	background: linear-gradient(135deg, var(--pwsms-primary) 0%, var(--pwsms-primary-dark) 100%);
	color: #fff;
	padding: 14px 22px;
	border-radius: var(--pwsms-radius);
	margin-bottom: 18px;
	box-shadow: var(--pwsms-shadow-md);
}
.pwsms-header-left {
	display: flex;
	align-items: center;
	gap: 10px;
}
.pwsms-header-icon {
	font-size: 24px;
	line-height: 1;
	opacity: .85;
}
.pwsms-header-name {
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -.01em;
}
.pwsms-header-badge {
	font-size: 11px;
	font-weight: 600;
	background: rgba(255,255,255,.18);
	padding: 2px 8px;
	border-radius: 99px;
	letter-spacing: .02em;
}
.pwsms-header-right {
	display: flex;
	gap: 8px;
}
.pwsms-header-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: #fff;
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
	background: rgba(255,255,255,.14);
	padding: 5px 14px;
	border-radius: 99px;
	transition: background var(--pwsms-transition);
}
.pwsms-header-link:hover,
.pwsms-header-link:focus {
	background: rgba(255,255,255,.26);
	color: #fff;
}
.pwsms-header-link .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

/* ── Pill tabs ──────────────────────────────────────────────── */
.pwsms-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0;
	margin: 0 0 22px;
	border: none;
}
.pwsms-tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 18px;
	font-size: 13px;
	font-weight: 500;
	color: var(--pwsms-grey-700);
	background: var(--pwsms-grey-100);
	border: 1px solid var(--pwsms-grey-300);
	border-radius: 99px;
	text-decoration: none;
	transition: all var(--pwsms-transition);
}
.pwsms-tab .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}
.pwsms-tab:hover {
	color: var(--pwsms-primary);
	border-color: var(--pwsms-primary);
	background: var(--pwsms-primary-light);
}
.pwsms-tab:focus {
	outline: 2px solid var(--pwsms-primary);
	outline-offset: 1px;
	box-shadow: none;
}
.pwsms-tab--active,
.pwsms-tab--active:hover {
	color: #fff;
	background: var(--pwsms-primary);
	border-color: var(--pwsms-primary);
}
.pwsms-tab--active .dashicons {
	color: #fff;
}

/* ── Tab hero ───────────────────────────────────────────────── */
.pwsms-tab-hero {
	background: linear-gradient(135deg, var(--pwsms-grey-100) 0%, #fff 100%);
	border: 1px solid var(--pwsms-grey-300);
	border-left: 4px solid var(--pwsms-primary);
	border-radius: var(--pwsms-radius-sm);
	padding: 18px 22px 20px;
	margin: 0 0 22px;
	box-shadow: var(--pwsms-shadow);
}
.pwsms-tab-hero-title {
	margin: 0 0 6px;
	font-size: 1.1em;
	font-weight: 600;
	color: var(--pwsms-grey-900);
}
.pwsms-tab-hero-text {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: var(--pwsms-grey-700);
	max-width: 52em;
}

/* ── API stepper ────────────────────────────────────────────── */
.pwsms-stepper {
	display: flex;
	flex-direction: column;
	gap: 0;
	position: relative;
	padding-left: 28px;
}
.pwsms-stepper::before {
	content: '';
	position: absolute;
	left: 15px;
	top: 22px;
	bottom: 22px;
	width: 2px;
	background: var(--pwsms-grey-300);
	border-radius: 2px;
}
.pwsms-step {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 16px 0;
	position: relative;
}
.pwsms-step-num {
	flex-shrink: 0;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--pwsms-grey-200);
	color: var(--pwsms-grey-600);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
	border: 2px solid var(--pwsms-grey-300);
	position: relative;
	z-index: 1;
	transition: all var(--pwsms-transition);
}
.pwsms-step-num--done {
	background: var(--pwsms-success);
	color: #fff;
	border-color: var(--pwsms-success);
}
.pwsms-step-body {
	flex: 1;
	min-width: 0;
}
.pwsms-step-title {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 600;
	color: var(--pwsms-grey-900);
}
.pwsms-step-title label {
	font-weight: 600;
	cursor: pointer;
}
.pwsms-step-desc {
	margin: 0 0 10px;
	font-size: 13px;
	color: var(--pwsms-grey-600);
}
.pwsms-step-body .button .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	vertical-align: text-bottom;
	margin-right: 2px;
}
.pwsms-step-body input.regular-text {
	display: block;
	margin-top: 4px;
}

/* ── Cards ──────────────────────────────────────────────────── */
.pwsms-card {
	background: #fff;
	border: 1px solid var(--pwsms-grey-300);
	box-shadow: var(--pwsms-shadow);
	padding: 0;
	margin: 0 0 16px;
	border-radius: var(--pwsms-radius);
	overflow: hidden;
	transition: opacity var(--pwsms-transition), border-color var(--pwsms-transition);
}
.pwsms-card--off {
	opacity: .7;
}
.pwsms-card--off .pwsms-template-wrap {
	display: none;
}

.pwsms-card-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 20px;
	background: var(--pwsms-grey-100);
	border-bottom: 1px solid var(--pwsms-grey-300);
}
.pwsms-card-title {
	flex: 1;
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--pwsms-grey-900);
}

/* status dot */
.pwsms-status-dot {
	flex-shrink: 0;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
}

/* toggle switch */
.pwsms-switch {
	position: relative;
	display: inline-block;
	width: 40px;
	height: 22px;
	flex-shrink: 0;
}
.pwsms-switch input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}
.pwsms-switch-slider {
	position: absolute;
	cursor: pointer;
	inset: 0;
	background: var(--pwsms-grey-400);
	border-radius: 22px;
	transition: background var(--pwsms-transition);
}
.pwsms-switch-slider::before {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	left: 3px;
	bottom: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform var(--pwsms-transition);
	box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.pwsms-switch input:checked + .pwsms-switch-slider {
	background: var(--pwsms-success);
}
.pwsms-switch input:checked + .pwsms-switch-slider::before {
	transform: translateX(18px);
}
.pwsms-switch input:focus + .pwsms-switch-slider {
	box-shadow: 0 0 0 2px var(--pwsms-primary);
}

/* template area inside card */
.pwsms-template-wrap {
	padding: 16px 20px 20px;
}
.pwsms-template-actions {
	margin-bottom: 8px;
}
.pwsms-template-wrap .pwsms-template-input {
	font-family: Consolas, Monaco, monospace;
	font-size: 13px;
	line-height: 1.45;
	border-radius: 4px;
	border-color: var(--pwsms-grey-500);
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* ── Placeholder tags (collapsible) ─────────────────────────── */
.pwsms-tags-panel {
	margin-top: 12px;
	border: 1px solid var(--pwsms-grey-300);
	border-radius: var(--pwsms-radius-sm);
	overflow: hidden;
}
.pwsms-tags-toggle {
	display: flex;
	align-items: center;
	gap: 6px;
	width: 100%;
	padding: 10px 14px;
	font-size: 12px;
	font-weight: 600;
	color: var(--pwsms-grey-700);
	background: var(--pwsms-grey-100);
	border: none;
	cursor: pointer;
	text-transform: uppercase;
	letter-spacing: .04em;
	transition: background var(--pwsms-transition);
}
.pwsms-tags-toggle:hover {
	background: var(--pwsms-grey-200);
}
.pwsms-tags-toggle .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	color: var(--pwsms-grey-600);
}
.pwsms-tags-toggle-arrow {
	margin-left: auto;
	transition: transform var(--pwsms-transition);
}
.pwsms-tags-panel.pwsms-tags--open .pwsms-tags-toggle-arrow {
	transform: rotate(180deg);
}

.pwsms-tag-groups {
	display: none;
	flex-direction: column;
	gap: 14px;
	padding: 14px 16px 16px;
	max-height: 300px;
	overflow-y: auto;
}
.pwsms-tags-panel.pwsms-tags--open .pwsms-tag-groups {
	display: flex;
}
.pwsms-tag-group-title {
	display: block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .03em;
	color: var(--pwsms-grey-600);
	margin-bottom: 6px;
}
.pwsms-tag-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}
.pwsms-tag-insert {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin: 0;
	padding: 4px 10px 4px 8px;
	min-height: 0;
	line-height: 1.3;
	font-size: 12px;
	background: #fff;
	border: 1px solid var(--pwsms-grey-400);
	border-radius: 99px;
	box-shadow: none;
	cursor: pointer;
	color: var(--pwsms-grey-900);
	transition: border-color var(--pwsms-transition), background var(--pwsms-transition);
}
.pwsms-tag-insert:hover {
	background: var(--pwsms-primary-light);
	border-color: var(--pwsms-primary);
}
.pwsms-tag-insert:focus {
	outline: 2px solid var(--pwsms-primary);
	outline-offset: 1px;
}
.pwsms-tag-label {
	font-weight: 500;
}
.pwsms-tag-code {
	font-family: Consolas, Monaco, monospace;
	font-size: 10px;
	color: var(--pwsms-grey-700);
	background: var(--pwsms-grey-200);
	padding: 1px 5px;
	border-radius: 3px;
}

/* ── Char count ─────────────────────────────────────────────── */
.pwsms-char-count {
	font-size: 12px;
	color: var(--pwsms-grey-600);
	margin: 8px 0 6px;
}
.pwsms-char-warn {
	color: var(--pwsms-error);
	font-weight: 600;
}

/* ── Chat bubble preview ────────────────────────────────────── */
.pwsms-preview {
	margin-top: 8px;
}
.pwsms-phone-frame {
	max-width: 340px;
	border: 2px solid var(--pwsms-grey-300);
	border-radius: 22px;
	padding: 14px 16px;
	background: var(--pwsms-grey-100);
	position: relative;
}
.pwsms-phone-frame::before {
	content: '';
	display: block;
	width: 40px;
	height: 4px;
	border-radius: 4px;
	background: var(--pwsms-grey-300);
	margin: 0 auto 10px;
}
.pwsms-bubble-header {
	font-size: 11px;
	color: var(--pwsms-grey-600);
	margin-bottom: 6px;
}
.pwsms-bubble-sender {
	font-weight: 600;
	color: var(--pwsms-grey-900);
}
.pwsms-bubble {
	background: #fff;
	padding: 10px 14px;
	border-radius: 16px 16px 16px 4px;
	font-size: 13px;
	line-height: 1.45;
	word-break: break-word;
	color: var(--pwsms-grey-900);
	box-shadow: 0 1px 2px rgba(0,0,0,.06);
	min-height: 20px;
}
.pwsms-preview-text:empty::before {
	content: attr(data-empty);
	color: var(--pwsms-grey-500);
	font-style: italic;
}

/* ── Counter (sender ID) ───────────────────────────────────── */
.pwsms-counter {
	margin-left: 8px;
	color: var(--pwsms-grey-600);
	font-size: 12px;
}

/* ── Section title (admin phones) ──────────────────────────── */
.pwsms-section-title {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 600;
	color: var(--pwsms-grey-900);
}
.pwsms-section-desc {
	margin: 0 0 14px;
	font-size: 13px;
	color: var(--pwsms-grey-600);
}

/* ── Admin phone rows ───────────────────────────────────────── */
.pwsms-admin-phone-repeater {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 10px;
	max-width: 640px;
}
.pwsms-admin-phone-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	background: #fff;
	border: 1px solid var(--pwsms-grey-300);
	border-radius: var(--pwsms-radius-sm);
	box-shadow: var(--pwsms-shadow);
	animation: pwsms-fadein .25s ease;
}
.pwsms-admin-phone-country {
	min-width: 200px;
	max-width: 100%;
}
.pwsms-admin-phone-local {
	flex: 1 1 180px;
	min-width: 140px;
}
.pwsms-admin-phone-remove {
	min-width: 30px;
	padding: 0 6px;
	font-size: 18px;
	line-height: 1;
	color: var(--pwsms-error);
}
.pwsms-admin-phone-remove:hover {
	color: #8a2424;
}
#pwsms-admin-phone-add .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	vertical-align: text-bottom;
}

/* ── Empty state ────────────────────────────────────────────── */
.pwsms-empty-state {
	text-align: center;
	padding: 40px 20px;
	color: var(--pwsms-grey-600);
}
.pwsms-empty-state .dashicons {
	font-size: 40px;
	width: 40px;
	height: 40px;
	display: block;
	margin: 0 auto 10px;
	color: var(--pwsms-grey-400);
}
.pwsms-empty-state h3 {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 600;
	color: var(--pwsms-grey-900);
}
.pwsms-empty-state p {
	margin: 0;
	font-size: 13px;
}
.pwsms-empty-state--inline {
	padding: 20px;
	text-align: left;
	display: flex;
	align-items: center;
	gap: 12px;
	background: var(--pwsms-grey-100);
	border: 1px dashed var(--pwsms-grey-400);
	border-radius: var(--pwsms-radius-sm);
	margin-bottom: 12px;
}
.pwsms-empty-state--inline .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
	margin: 0;
}
.pwsms-empty-state--inline p {
	margin: 0;
}

/* ── Test tab ───────────────────────────────────────────────── */
.pwsms-test-fields {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}
.pwsms-test-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.pwsms-test-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--pwsms-grey-900);
}
.pwsms-test-phone-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}
.pwsms-test-phone-wrap .pwsms-admin-phone-country {
	min-width: 200px;
}
.pwsms-test-phone-wrap .regular-text {
	flex: 1 1 180px;
	min-width: 140px;
}
.pwsms-test-hint {
	font-size: 12px;
	color: var(--pwsms-grey-600);
	font-style: italic;
	margin: 4px 0 0;
}
#pwsms-btn-send-test {
	align-self: flex-start;
}
#pwsms-btn-send-test .dashicons {
	font-size: 15px;
	width: 15px;
	height: 15px;
	vertical-align: text-bottom;
	margin-right: 2px;
}
.pwsms-result {
	margin-left: 10px;
	font-weight: 600;
}

/* ── Save button ────────────────────────────────────────────── */
.pwsms-save-btn {
	min-width: 140px;
	text-align: center;
}

/* ── Toast notifications ────────────────────────────────────── */
.pwsms-toast-wrap {
	position: fixed;
	bottom: 30px;
	right: 30px;
	z-index: 999999;
	display: flex;
	flex-direction: column-reverse;
	gap: 8px;
	pointer-events: none;
}
.pwsms-toast {
	min-width: 260px;
	max-width: 400px;
	padding: 12px 18px;
	border-radius: var(--pwsms-radius-sm);
	font-size: 13px;
	font-weight: 500;
	color: #fff;
	box-shadow: var(--pwsms-shadow-md);
	pointer-events: auto;
	animation: pwsms-slide-up .35s ease;
	display: flex;
	align-items: center;
	gap: 8px;
}
.pwsms-toast .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}
.pwsms-toast--success {
	background: var(--pwsms-success);
}
.pwsms-toast--error {
	background: var(--pwsms-error);
}
.pwsms-toast--info {
	background: var(--pwsms-primary);
}

/* ── Spinner ────────────────────────────────────────────────── */
.pwsms-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid var(--pwsms-grey-400);
	border-top-color: var(--pwsms-primary);
	border-radius: 50%;
	animation: pwsms-spin .6s linear infinite;
	vertical-align: middle;
	margin-left: 8px;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes pwsms-fadein {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}
@keyframes pwsms-slide-up {
	from { opacity: 0; transform: translateY(16px); }
	to   { opacity: 1; transform: translateY(0); }
}
@keyframes pwsms-spin {
	to { transform: rotate(360deg); }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 782px) {
	.pwsms-header {
		flex-direction: column;
		align-items: flex-start;
	}
	.pwsms-tabs {
		gap: 4px;
	}
	.pwsms-tab {
		padding: 7px 14px;
		font-size: 12px;
	}
	.pwsms-stepper {
		padding-left: 20px;
	}
	.pwsms-phone-frame {
		max-width: 100%;
	}
	.pwsms-tag-groups {
		max-height: 220px;
	}
	.pwsms-admin-phone-row {
		flex-direction: column;
		align-items: stretch;
	}
	.pwsms-admin-phone-country {
		min-width: 0;
	}
}
