/* ==========================================================================
   Adoovy Media Offload - Admin Styles
   Developed by Adoovy
   ========================================================================== */

:root {
	--smof-ink: #0f172a;
	--smof-text: #1e293b;
	--smof-text-secondary: #475569;
	--smof-text-muted: #64748b;
	--smof-border: #e2e8f0;
	--smof-border-strong: #cbd5e1;
	--smof-bg: #f4f6fb;
	--smof-surface: #ffffff;
	--smof-surface-alt: #f8fafc;

	--smof-accent: #4f46e5;
	--smof-accent-hover: #4338ca;
	--smof-accent-soft: #eef2ff;
	--smof-accent-ring: rgba(79, 70, 229, 0.18);
	--smof-violet: #7c3aed;

	--smof-success: #059669;
	--smof-success-soft: #ecfdf5;
	--smof-success-border: #a7f3d0;
	--smof-warning: #d97706;
	--smof-warning-soft: #fffbeb;
	--smof-warning-border: #fde68a;
	--smof-danger: #dc2626;
	--smof-danger-soft: #fef2f2;
	--smof-danger-border: #fecaca;

	--smof-radius-sm: 8px;
	--smof-radius-md: 12px;
	--smof-radius-lg: 16px;
	--smof-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
	--smof-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 10px 24px -6px rgba(15, 23, 42, 0.08);
	--smof-ease: 180ms cubic-bezier(0.4, 0, 0.2, 1);
	--smof-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
	--smof-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ==========================================================================
   Page shell
   ========================================================================== */
#wpcontent {
	background: var(--smof-bg);
	padding: 0;
}

#smof,
.smof-topbar {
	font-family: var(--smof-font);
	color: var(--smof-text);
	-webkit-font-smoothing: antialiased;
}

#smof .wrap {
	max-width: 1120px;
	margin: 0 auto;
	padding: 0 24px 40px;
}

#smof form {
	margin-top: 28px;
}

/* ==========================================================================
   Header (brand hero)
   ========================================================================== */
.smof-topbar .smof-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
	padding: 28px 32px;
	background:
		radial-gradient(900px 260px at 100% -40%, rgba(124, 58, 237, 0.45), transparent 60%),
		radial-gradient(600px 220px at 0% 140%, rgba(79, 70, 229, 0.5), transparent 60%),
		linear-gradient(135deg, #0b1020 0%, #17153b 55%, #241f5c 100%);
	color: #fff;
}

.smof-topbar .smof-brand {
	display: flex;
	align-items: center;
	gap: 16px;
}

.smof-topbar .smof-logo {
	display: inline-flex;
	flex-shrink: 0;
	filter: drop-shadow(0 6px 14px rgba(79, 70, 229, 0.55));
}

.smof-topbar .smof-brand-text h1 {
	margin: 0;
	padding: 0;
	font-family: var(--smof-font);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: #fff;
}

.smof-topbar .smof-tagline {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	color: rgba(226, 232, 240, 0.75);
	letter-spacing: 0.01em;
}

.smof-topbar .smof-header-meta {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.smof-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 14px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.16);
	color: #e2e8f0;
	backdrop-filter: blur(6px);
}

.smof-chip .smof-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #94a3b8;
}

.smof-chip--ok .smof-dot {
	background: #34d399;
	box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.22);
}

.smof-chip--warn .smof-dot {
	background: #fbbf24;
	box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.22);
}

.smof-chip--version {
	background: rgba(255, 255, 255, 0.06);
	color: #cbd5e1;
	font-weight: 500;
}

/* Navigation */
.smof-topbar .smof-menu {
	padding: 0 32px;
	background: var(--smof-surface);
	border-bottom: 1px solid var(--smof-border);
	box-shadow: var(--smof-shadow-sm);
}

.smof-topbar .smof-menu nav {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 10px 0;
}

.smof-topbar .smof-menu nav a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border-radius: var(--smof-radius-sm);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	color: var(--smof-text-secondary);
	outline: none;
	box-shadow: none;
	transition: background var(--smof-ease), color var(--smof-ease);
}

.smof-topbar .smof-menu nav a svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.smof-topbar .smof-menu nav a:hover {
	background: var(--smof-surface-alt);
	color: var(--smof-ink);
}

.smof-topbar .smof-menu nav a.active,
.smof-topbar .smof-menu nav a:focus {
	background: var(--smof-accent-soft);
	color: var(--smof-accent);
}

.smof-topbar .smof-menu nav a:focus-visible {
	box-shadow: 0 0 0 3px var(--smof-accent-ring);
}

@media (max-width: 600px) {
	.smof-topbar {
		position: relative;
		top: 46px;
	}

	.smof-topbar .smof-header {
		padding: 22px 20px;
	}

	.smof-topbar .smof-menu {
		padding: 0 16px;
	}
}

/* ==========================================================================
   Section cards
   ========================================================================== */
#smof .smof-section {
	position: relative;
	margin-top: 24px;
	background: var(--smof-surface);
	border: 1px solid var(--smof-border);
	border-radius: var(--smof-radius-lg);
	box-shadow: var(--smof-shadow-sm);
	overflow: hidden;
	transition: box-shadow var(--smof-ease);
}

#smof .smof-section:hover {
	box-shadow: var(--smof-shadow-md);
}

#smof .smof-section-header {
	padding: 20px 28px;
	background: linear-gradient(180deg, #fbfcff 0%, var(--smof-surface-alt) 100%);
	border-bottom: 1px solid var(--smof-border);
	position: relative;
}

#smof .smof-section-header::before {
	content: "";
	position: absolute;
	left: 0;
	top: 18px;
	bottom: 18px;
	width: 4px;
	border-radius: 0 4px 4px 0;
	background: linear-gradient(180deg, var(--smof-accent), var(--smof-violet));
}

#smof .smof-section-header h2 {
	margin: 0 0 4px;
	padding: 0;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--smof-ink);
}

#smof .smof-section-header p {
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
	color: var(--smof-text-muted);
}

/* ==========================================================================
   Form tables
   ========================================================================== */
#smof .form-table {
	margin: 0;
	background: var(--smof-surface);
}

#smof .form-table th {
	width: 220px;
	padding: 24px 16px 24px 28px;
	vertical-align: top;
	background: var(--smof-surface);
	border-bottom: 1px solid var(--smof-border);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.5;
	color: var(--smof-ink);
}

#smof .form-table td {
	padding: 24px 28px 24px 16px;
	vertical-align: top;
	background: var(--smof-surface);
	border-bottom: 1px solid var(--smof-border);
}

#smof .form-table tr:last-child th,
#smof .form-table tr:last-child td {
	border-bottom: none;
}

@media screen and (max-width: 782px) {
	#smof .form-table {
		width: 100%;
	}

	#smof .form-table th,
	#smof .form-table td {
		display: block;
		width: 100%;
		padding: 16px 20px;
		border-bottom: none;
	}

	#smof .form-table th {
		padding-bottom: 0;
	}
}

/* Inputs */
#smof select,
#smof input[type="text"],
#smof input[type="password"] {
	box-sizing: border-box;
	width: 100%;
	max-width: 440px;
	min-height: 42px;
	padding: 9px 14px;
	border: 1px solid var(--smof-border-strong);
	border-radius: var(--smof-radius-sm);
	background-color: #fff;
	font-family: var(--smof-font);
	font-size: 14px;
	line-height: 1.4;
	color: var(--smof-ink);
	box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
	transition: border-color var(--smof-ease), box-shadow var(--smof-ease), background var(--smof-ease);
}

#smof select:hover,
#smof input[type="text"]:hover,
#smof input[type="password"]:hover {
	border-color: #94a3b8;
}

#smof select:focus,
#smof input[type="text"]:focus,
#smof input[type="password"]:focus {
	border-color: var(--smof-accent);
	box-shadow: 0 0 0 4px var(--smof-accent-ring);
	outline: none;
}

#smof .description {
	margin: 8px 0 0;
	font-style: normal;
	font-size: 13px;
	line-height: 1.6;
	color: var(--smof-text-muted);
}

#smof code {
	padding: 2px 7px;
	border-radius: 6px;
	background: var(--smof-accent-soft);
	color: var(--smof-accent-hover);
	font-family: var(--smof-mono);
	font-size: 12px;
}

#smof .smof-credentials-field {
	margin-bottom: 16px;
}

#smof .smof-credentials-field label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
}

#smof input[type="checkbox"] {
	margin-right: 8px;
}

/* ==========================================================================
   Radio options (selectable cards)
   ========================================================================== */
.smof-radio-group {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.smof-radio-option {
	position: relative;
	padding: 16px 18px 16px 52px;
	background: var(--smof-surface);
	border: 1.5px solid var(--smof-border);
	border-radius: var(--smof-radius-md);
	transition: border-color var(--smof-ease), background var(--smof-ease), box-shadow var(--smof-ease);
}

.smof-radio-option:hover {
	border-color: var(--smof-border-strong);
	background: var(--smof-surface-alt);
}

.smof-radio-option:has(input[type="radio"]:checked) {
	border-color: var(--smof-accent);
	background: var(--smof-accent-soft);
	box-shadow: 0 0 0 4px var(--smof-accent-ring);
}

.smof-radio-option input[type="radio"] {
	position: absolute;
	left: 18px;
	top: 18px;
	margin: 0;
	cursor: pointer;
	border-color: var(--smof-border-strong);
}

.smof-radio-option input[type="radio"]:checked {
	background: #fff;
	border-color: var(--smof-accent);
}

.smof-radio-option input[type="radio"]:checked::before {
	background-color: var(--smof-accent);
}

.smof-radio-option input[type="radio"]:focus {
	box-shadow: 0 0 0 4px var(--smof-accent-ring);
	border-color: var(--smof-accent);
}

.smof-radio-option label {
	display: block;
	margin-bottom: 4px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	color: var(--smof-ink);
}

.smof-radio-option .description {
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
	color: var(--smof-text-muted);
}

@media screen and (max-width: 782px) {
	.smof-radio-option input[type="radio"] {
		width: 20px;
		height: 20px;
	}
}

/* ==========================================================================
   Checkbox options (toggle switches)
   ========================================================================== */
.smof-checkbox-option {
	position: relative;
	margin-bottom: 0;
	padding-left: 56px;
	min-height: 24px;
}

#smof .smof-checkbox-option input[type="checkbox"] {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	left: 0;
	top: 0;
	width: 42px;
	height: 24px;
	min-width: 42px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 999px;
	background: var(--smof-border-strong);
	box-shadow: none;
	cursor: pointer;
	transition: background var(--smof-ease), box-shadow var(--smof-ease);
}

#smof .smof-checkbox-option input[type="checkbox"]::before {
	content: "" !important;
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	margin: 0 !important;
	border-radius: 50%;
	background: #fff !important;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
	transform: none;
	transition: transform var(--smof-ease);
}

#smof .smof-checkbox-option input[type="checkbox"]:checked {
	background: linear-gradient(135deg, var(--smof-accent), var(--smof-violet));
}

#smof .smof-checkbox-option input[type="checkbox"]:checked::before {
	content: "" !important;
	width: 18px;
	height: 18px;
	margin: 0 !important;
	transform: translateX(18px);
}

#smof .smof-checkbox-option input[type="checkbox"]:focus {
	box-shadow: 0 0 0 4px var(--smof-accent-ring);
	outline: none;
}

#smof .smof-checkbox-option input[type="checkbox"]:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.smof-checkbox-option label {
	display: inline-block;
	margin-bottom: 2px;
	padding-top: 2px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	color: var(--smof-ink);
}

.smof-checkbox-option .description {
	margin-top: 4px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--smof-text-muted);
}

/* Path prefix input under its toggle */
#smof .smof-checkbox-option input[type="text"]#path_prefix {
	width: 100%;
	max-width: 340px;
	margin-top: 10px;
	font-family: var(--smof-mono);
	font-size: 13px;
}

#smof .smof-checkbox-option input[type="text"]#path_prefix:disabled {
	background-color: var(--smof-surface-alt);
	color: var(--smof-text-muted);
	border-color: var(--smof-border);
	cursor: not-allowed;
}

.smof-checkbox-option input[type="checkbox"]:not(:checked) ~ input#path_prefix {
	opacity: 0.7;
}

/* Code snippets */
.smof-code-snippet {
	margin-top: 14px;
	padding: 14px 16px;
	border-radius: var(--smof-radius-sm);
	background: #0f172a;
	border: 1px solid #1e293b;
	color: #e2e8f0;
	font-family: var(--smof-mono);
	font-size: 12px;
	line-height: 1.7;
	direction: ltr;
	text-align: left;
	white-space: pre-wrap;
	word-break: break-all;
}

/* ==========================================================================
   Credentials
   ========================================================================== */
.smof-credentials-container {
	margin-top: 0;
}

.smof-credentials-info {
	margin-bottom: 20px;
	padding: 14px 18px;
	background: var(--smof-accent-soft);
	border: 1px solid #c7d2fe;
	border-radius: var(--smof-radius-md);
}

.smof-credentials-info p {
	margin: 0;
	font-size: 13px;
	line-height: 1.7;
	color: var(--smof-text-secondary);
}

.smof-credentials-info strong {
	color: var(--smof-ink);
}

.smof-credentials-info code {
	background: rgba(79, 70, 229, 0.1);
}

.smof-provider-description {
	margin-bottom: 20px !important;
	padding: 14px 18px !important;
	background: var(--smof-surface-alt) !important;
	border: 1px solid var(--smof-border) !important;
	border-radius: var(--smof-radius-md) !important;
}

.smof-provider-description p {
	margin: 0 !important;
	font-size: 13px;
	line-height: 1.7;
	color: var(--smof-text-secondary);
}

.smof-credential-fields {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	margin-bottom: 20px;
}

.smof-credential-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.smof-credential-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--smof-ink);
}

.smof-credential-field .description {
	margin: 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--smof-text-muted);
}

/* Password field with toggle */
.smof-password-field-wrapper {
	position: relative;
	display: flex;
	align-items: center;
	max-width: 440px;
}

.smof-password-field-wrapper .smof-password-input {
	flex: 1;
	padding-right: 44px !important;
}

.smof-toggle-password {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0 !important;
	border: none;
	border-radius: 6px !important;
	background: transparent !important;
	color: var(--smof-text-muted) !important;
	cursor: pointer !important;
	transition: color var(--smof-ease), background var(--smof-ease);
}

.smof-toggle-password:hover {
	color: var(--smof-accent) !important;
	background: var(--smof-accent-soft) !important;
}

.smof-toggle-password:focus {
	outline: none;
	box-shadow: 0 0 0 3px var(--smof-accent-ring) !important;
}

.smof-toggle-password .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
}

/* Fields locked by wp-config.php */
.smof-credential-field.smof-field-disabled input {
	background-color: var(--smof-surface-alt);
	color: var(--smof-text-muted);
	cursor: not-allowed;
	opacity: 0.8;
}

.smof-credential-field.smof-field-disabled label {
	color: var(--smof-text-muted);
}

.smof-credential-field.smof-field-disabled .description {
	color: var(--smof-text-muted);
	font-style: italic;
}

/* ==========================================================================
   Notifications and connection status
   ========================================================================== */
#smof .smof-notification {
	margin-top: 20px;
	padding: 14px 18px;
	border: 1px solid;
	border-radius: var(--smof-radius-md);
	font-size: 13px;
	line-height: 1.6;
}

#smof .smof-notification.success {
	background: var(--smof-success-soft);
	border-color: var(--smof-success-border);
	color: #065f46;
}

#smof .smof-notification.error {
	background: var(--smof-danger-soft);
	border-color: var(--smof-danger-border);
	color: #991b1b;
}

.smof-test-connection-container {
	margin-top: 12px;
}

.smof-last-check {
	max-width: 440px;
	margin-bottom: 16px !important;
	padding: 12px 16px;
	border: 1px solid;
	border-radius: var(--smof-radius-md);
	font-size: 13px;
	transition: opacity 0.3s ease-out;
}

.smof-last-check.connected {
	background: var(--smof-success-soft);
	border-color: var(--smof-success-border);
	color: #065f46;
}

.smof-last-check.disconnected {
	background: var(--smof-danger-soft);
	border-color: var(--smof-danger-border);
	color: #991b1b;
}

.smof-fade-out,
.smof-last-check.smof-fade-out {
	opacity: 0;
	transition: opacity 0.3s ease;
}

@media screen and (max-width: 782px) {
	.smof-last-check {
		max-width: 100%;
	}
}

.smof-connection-status {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 20px 0 16px;
	padding: 12px 18px;
	border: 1px solid;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 500;
	animation: smofSlideIn 0.3s ease-out;
}

.smof-connection-status.connected {
	background: var(--smof-success-soft);
	border-color: var(--smof-success-border);
	color: #065f46;
}

.smof-connection-status.disconnected {
	background: var(--smof-warning-soft);
	border-color: var(--smof-warning-border);
	color: #92400e;
}

.smof-connection-status .dashicons {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	font-size: 18px;
}

.smof-connection-status.connected .dashicons {
	color: var(--smof-success);
}

.smof-connection-status.disconnected .dashicons {
	color: var(--smof-warning);
}

.smof-status-text {
	font-weight: 700;
}

.smof-status-time {
	margin-left: 6px;
	font-size: 12px;
	color: inherit;
	opacity: 0.75;
}

@keyframes smofSlideIn {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
#smof .button,
#smof .button-secondary {
	min-height: 40px;
	padding: 8px 18px;
	border: 1px solid var(--smof-border-strong);
	border-radius: var(--smof-radius-sm);
	background: #fff;
	color: var(--smof-ink);
	font-family: var(--smof-font);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.5;
	box-shadow: var(--smof-shadow-sm);
	transition: all var(--smof-ease);
}

#smof .button:hover,
#smof .button-secondary:hover {
	border-color: var(--smof-accent);
	background: var(--smof-accent-soft);
	color: var(--smof-accent-hover);
}

#smof .button:focus {
	box-shadow: 0 0 0 4px var(--smof-accent-ring);
	outline: none;
}

#smof .button-primary,
.smof-save-credentials {
	min-height: 42px;
	padding: 9px 24px;
	border: none !important;
	border-radius: var(--smof-radius-sm);
	background: linear-gradient(135deg, var(--smof-accent) 0%, var(--smof-violet) 100%) !important;
	color: #fff !important;
	font-family: var(--smof-font);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.5;
	text-shadow: none;
	cursor: pointer;
	box-shadow: 0 4px 14px -2px rgba(79, 70, 229, 0.5);
	transition: all var(--smof-ease);
}

#smof .button-primary:hover,
.smof-save-credentials:hover {
	filter: brightness(1.08);
	transform: translateY(-1px);
	box-shadow: 0 8px 20px -4px rgba(79, 70, 229, 0.55);
}

#smof .button-primary:focus,
.smof-save-credentials:focus {
	outline: none;
	box-shadow: 0 0 0 4px var(--smof-accent-ring), 0 4px 14px -2px rgba(79, 70, 229, 0.5);
}

#smof .submit {
	margin-top: 28px;
	padding: 20px 0 0;
	text-align: left;
	border-top: 1px solid var(--smof-border);
}

.smof-credentials-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-top: 8px;
}

.smof-save-credentials {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	height: auto !important;
	font-size: 13px !important;
	padding: 9px 20px !important;
}

.smof-save-credentials .dashicons {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	font-size: 16px;
	line-height: 1;
}

.smof_js_test_connection {
	height: auto;
	font-size: 13px;
	line-height: 1.5;
}

.smof_js_test_connection:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Loading / success states (toggled by JS) */
.smof_js_test_connection.loading {
	position: relative;
	color: transparent !important;
	pointer-events: none;
}

.smof_js_test_connection.loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 14px;
	margin: -7px 0 0 -7px;
	border: 2px solid rgba(15, 23, 42, 0.12);
	border-top-color: var(--smof-accent);
	border-radius: 50%;
	animation: smofSpin 0.6s linear infinite;
}

#smof .button-primary.loading,
.smof-save-credentials.loading {
	position: relative;
	color: transparent !important;
	pointer-events: none;
	opacity: 0.92;
}

button.button-primary.loading::after,
button.smof-save-credentials.loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 14px;
	margin: -7px 0 0 -7px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: smofSpin 0.6s linear infinite;
}

#smof .button-primary.loading .dashicons,
.smof-save-credentials.loading .dashicons {
	opacity: 0;
}

.smof-button-wrapper {
	position: relative;
	display: inline-block;
}

.smof-button-wrapper::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 14px;
	margin: -7px 0 0 -7px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: smofSpin 0.6s linear infinite;
}

#smof .button-primary.success,
.smof-save-credentials.success {
	background: linear-gradient(135deg, #059669, #10b981) !important;
	box-shadow: 0 4px 14px -2px rgba(5, 150, 105, 0.5);
	animation: smofSuccessPulse 0.4s ease;
}

#smof .button-primary.success .dashicons,
.smof-save-credentials.success .dashicons {
	animation: smofCheckmarkAppear 0.3s ease 0.1s backwards;
}

@media screen and (max-width: 782px) {
	.smof-credentials-actions {
		width: 100%;
		gap: 8px;
	}

	.smof-save-credentials,
	.smof_js_test_connection {
		flex: 1;
		justify-content: center;
		min-width: 130px;
	}

	.smof-credential-field input[type="text"],
	.smof-credential-field input[type="password"],
	.smof-password-field-wrapper {
		max-width: 100%;
	}

	.smof-connection-status {
		display: flex;
		flex-wrap: wrap;
		width: 100%;
		border-radius: var(--smof-radius-md);
	}

	.smof-status-time {
		flex-basis: 100%;
		margin: 4px 0 0 28px;
	}
}

@keyframes smofSpin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

@keyframes smofSuccessPulse {
	0% { transform: scale(1); }
	50% { transform: scale(1.04); }
	100% { transform: scale(1); }
}

@keyframes smofCheckmarkAppear {
	0% { opacity: 0; transform: scale(0.6); }
	100% { opacity: 1; transform: scale(1); }
}

.smof-ajax-error {
	animation: smofSlideDown 0.3s ease-out;
}

@keyframes smofSlideDown {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* AJAX save overlay */
.smof-section-overlay {
	position: absolute;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.75);
	backdrop-filter: blur(2px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.smof-section-overlay.active {
	opacity: 1;
	pointer-events: all;
}

.smof-section-overlay::after {
	content: "";
	width: 34px;
	height: 34px;
	border: 3px solid rgba(79, 70, 229, 0.15);
	border-top-color: var(--smof-accent);
	border-radius: 50%;
	animation: smofSpin 0.6s linear infinite;
}

/* ==========================================================================
   Bulk offload & progress
   ========================================================================== */
.smof-field.smof-bulk-offload-media th {
	display: none;
}

#smof-bulk-offload-button {
	margin: 0.6rem 0;
}

#smof-bulk-offload-cancel-button {
	display: inline-block;
	margin: 1rem 0;
}

.smof-progress-bar-container {
	width: 100%;
	margin-top: 20px;
	padding: 4px;
	border-radius: 999px;
	background: #e2e8f0;
	box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.1);
}

#smof-offload-progress {
	width: 0;
	height: 14px;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--smof-accent), var(--smof-violet));
	transition: width 0.5s ease;
}

#smof-progress-title {
	margin-bottom: 10px;
	font-size: 16px;
	font-weight: 700;
	color: var(--smof-ink);
}

#smof-progress-text {
	margin-top: 10px;
	font-weight: 600;
	color: var(--smof-text-secondary);
}

/* ==========================================================================
   Footer credit
   ========================================================================== */
.smof-footer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
	margin: 36px 0 8px;
	padding-top: 22px;
	border-top: 1px solid var(--smof-border);
	font-size: 12.5px;
	color: var(--smof-text-muted);
}

.smof-footer strong {
	color: var(--smof-ink);
	font-weight: 700;
}

.smof-footer .smof-footer-sep {
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: var(--smof-border-strong);
}

.smof-footer a {
	color: var(--smof-accent);
	font-weight: 700;
	text-decoration: none;
}

.smof-footer a:hover {
	color: var(--smof-accent-hover);
	text-decoration: underline;
}

/* Bulk offload notices (moved from inline styles) */
.smof-cli-notice {
	margin-bottom: 20px;
	padding: 14px 16px;
	background: var(--smof-accent-soft);
	border: 1px solid #c7d2fe;
	border-radius: var(--smof-radius-md);
}

.smof-cli-notice p {
	margin: 0 0 8px;
}

.smof-cli-notice p:last-child {
	margin-bottom: 0;
}

.smof-cli-notice__title strong {
	color: var(--smof-accent);
}

.smof-cli-notice__text {
	font-size: 13px;
}
