/*
 * Image Resizer & Social Cropper — module-scoped styling.
 *
 * Brand-focused redesign with:
 * - Brand color #026ed0 for primary actions and accents
 * - Alternating section backgrounds (white + ultra-light blue tint)
 * - Subtle borders instead of heavy shadows
 * - Left accent bars for key areas
 * - Reduced whitespace, increased density
 * - Clean, professional, lightweight aesthetic
 */

:root {
	--ir-brand: #026ed0;
	--ir-brand-light: rgba(2, 110, 208, 0.04);
	--ir-brand-border: rgba(2, 110, 208, 0.15);
	--ir-brand-hover: #0252a3;
	--ir-bg-white: #ffffff;
	--ir-border: #e5e7eb;
	--ir-text-primary: #111827;
	--ir-text-secondary: #4b5563;
	--ir-text-muted: #6b7280;
}

.lct-ir-root {
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--ir-text-primary);
	box-sizing: border-box;
	width: 100%;
	display: block;
}
.lct-ir-root *,
.lct-ir-root *::before,
.lct-ir-root *::after { box-sizing: border-box; }

/* Prevent layout shift when scrollbar appears */
.lct-ir-controls {
	scrollbar-gutter: stable;
	width: 100%;
	display: block;
}

/* Header */
.lct-ir-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

/* Three-column grid: left sidebar | center preview | right controls */
.lct-ir-grid {
	display: grid;
	grid-template-columns: 320px minmax(0, 1fr) 380px;
	gap: 0;
	align-items: stretch;
	box-shadow: 5px 3px 10px rgba(0, 0, 0, 0.05);
	border: 1px solid #d1d6dc;
}
@media (max-width: 1199px) {
	.lct-ir-grid {
		grid-template-columns: 280px minmax(0, 1fr) 320px;
	}
}
@media (max-width: 1023px) {
	.lct-ir-grid {
		grid-template-columns: 1fr;
	}
}

/* Sidebar containers */
.lct-ir-sidebar,
.lct-ir-sidebar-right,
.lct-ir-preview-main {
	background: var(--ir-bg-white);
	border: none;
	overflow-y: auto;
}

.lct-ir-sidebar {
	border-right: 1px solid var(--ir-border);
}

.lct-ir-preview-main {
	border-right: 1px solid var(--ir-border);
	display: flex;
	flex-direction: column;
}

/* Cards */
.lct-ir-card,
.lct-ir-panel-card,
.lct-ir-output-card,
.lct-ir-preview-card,
.lct-ir-sidebar-card {
	background: var(--ir-bg-white);
	border: none;
	border-radius: 0;
	padding: 1.5rem;
	box-shadow: none;
}

.lct-ir-sidebar-card {
	padding: 0;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.lct-ir-sidebar-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 1.5rem 1.5rem 12px 1.5rem;
	border-bottom: 1px solid var(--ir-border);
	flex-wrap: wrap;
}

.lct-shortcode-tool .lct-ir-sidebar-head h3 {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 400;
	color: var(--ir-text-primary);
}

.lct-ir-sidebar-content {
	flex: 1;
	overflow-y: auto;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.lct-ir-sidebar-tabs {
	display: flex;
	gap: 8px;
	border-bottom: 1px solid var(--ir-border);
	margin: 0;
	padding: 1.5rem 1.5rem 0 1.5rem;
	background: var(--ir-bg-white);
}

.lct-ir-sidebar-tab {
	background: none;
	border: none;
	padding: 8px 12px;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--ir-text-secondary);
	cursor: pointer;
	border-bottom: 2px solid transparent;
	transition: all .15s;
	margin-bottom: -1px;
}

.lct-ir-sidebar-tab:hover {
	color: var(--ir-text-primary);
}

.lct-ir-sidebar-tab.is-active {
	color: var(--ir-brand);
	border-bottom-color: var(--ir-brand);
}

.lct-ir-sidebar-section {
	display: none;
	padding: 1.5rem;
	border-bottom: 1px solid var(--ir-border);
}

.lct-ir-sidebar-section:last-child {
	border-bottom: none;
}

.lct-ir-sidebar-section[data-panel]:not([hidden]),
.lct-ir-sidebar-section:not([hidden]) {
	display: block;
}

.lct-ir-card-head,
.lct-ir-preview-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.lct-shortcode-tool .lct-ir-card-head h3,
.lct-shortcode-tool .lct-ir-preview-head h3 {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 400;
	color: var(--ir-text-primary);
}

/* Field styling */
.lct-ir-field-label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: .85rem;
	font-weight: 600;
	margin-bottom: 4px;
	color: var(--ir-text-primary);
}

.lct-ir-input,
.lct-ir-select {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--ir-border);
	border-radius: 3px;
	font-size: .9rem;
	font-family: inherit;
	background: var(--ir-bg-white);
	color: var(--ir-text-primary);
	transition: border-color .15s, box-shadow .15s;
}
.lct-ir-input:focus,
.lct-ir-select:focus {
	outline: none;
	border-color: var(--ir-brand);
	box-shadow: 0 0 0 3px rgba(2, 110, 208, 0.1), inset 0 0 0 1px var(--ir-brand);
}
.lct-ir-input::placeholder {
	color: var(--ir-text-muted);
}

/* Checkbox styling */
.lct-ir-checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.9rem;
	cursor: pointer;
	padding: 6px 8px;
	border-radius: 3px;
	transition: background-color .15s;
	user-select: none;
}

.lct-ir-checkbox:hover {
	background-color: var(--ir-brand-light);
}

.lct-ir-checkbox input[type="checkbox"] {
	cursor: pointer;
	margin: 0;
	width: 18px;
	height: 18px;
	min-width: 18px;
	flex-shrink: 0;
	accent-color: var(--ir-brand);
}

.lct-ir-checkbox span {
	flex: 1;
	color: var(--ir-text-primary);
}

/* Field help text */
.lct-ir-field-help {
	font-size: 0.75rem;
	color: var(--ir-text-muted);
	line-height: 1.4;
	margin: 4px 0 0 0;
}

/* Range input styling */
.lct-ir-range {
	width: 100%;
	height: 6px;
	border-radius: 3px;
	background: var(--ir-border);
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

.lct-ir-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--ir-brand);
	cursor: pointer;
	transition: background-color .15s;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lct-ir-range::-webkit-slider-thumb:hover {
	background: var(--ir-brand-hover);
}

.lct-ir-range::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--ir-brand);
	cursor: pointer;
	border: none;
	transition: background-color .15s;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.lct-ir-range::-moz-range-thumb:hover {
	background: var(--ir-brand-hover);
}

/* Dimensions container in sidebar */
.lct-ir-sidebar-section .lct-ir-dims {
	display: flex;
	gap: 8px;
	align-items: flex-end;
	margin-bottom: 16px;
}

.lct-ir-sidebar-section .lct-ir-field {
	flex: 1;
	margin-top: 0;
	margin-bottom: 0;
}

.lct-ir-lock {
	flex-shrink: 0;
	background: var(--ir-bg-white);
	border: 1px solid var(--ir-border);
	padding: 8px;
	border-radius: 3px;
	cursor: pointer;
	transition: all .15s;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	color: var(--ir-text-secondary);
	position: relative;
}

.lct-ir-lock.is-locked {
	color: #22c55e;
	border-color: #22c55e;
}

.lct-ir-lock.is-locked:hover {
	background: rgba(34, 197, 94, 0.1);
}

.lct-ir-lock:not(.is-locked) {
	color: #9ca3af;
}

.lct-ir-lock:not(.is-locked):hover {
	border-color: var(--ir-brand);
	color: var(--ir-brand);
	background: var(--ir-brand-light);
}

.lct-ir-lock.is-locked:hover {
	border-color: #22c55e;
	color: #22c55e;
	background: rgba(34, 197, 94, 0.1);
}

.lct-ir-lock svg {
	display: block;
}

.lct-ir-lock svg[hidden] {
	display: none;
}

/* Diagonal line through unlock icon */
.lct-ir-lock:not(.is-locked)::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) rotate(-45deg);
	width: 2px;
	height: 20px;
	background: currentColor;
	border-radius: 1px;
	pointer-events: none;
}

/* Collapse/Details styling */
.lct-ir-collapse {
	margin: 12px 0 0 0;
}

.lct-ir-collapse-head {
	cursor: pointer;
	color: var(--ir-brand);
	font-weight: 500;
	font-size: 0.9rem;
	padding: 8px 0;
	transition: color .15s;
	user-select: none;
}

.lct-ir-collapse-head:hover {
	color: var(--ir-brand-hover);
}

.lct-ir-collapse-body {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--ir-border);
}

/* Dropzone styling */
.lct-ir-dropzone {
	position: relative;
	border: 2px dashed var(--ir-border);
	border-radius: 4px;
	padding: 24px 16px;
	text-align: center;
	cursor: pointer;
	transition: all .15s;
	background: rgba(2, 110, 208, 0.02);
	margin: 0;
}

.lct-ir-dropzone:hover {
	border-color: var(--ir-brand);
	background: rgba(2, 110, 208, 0.06);
}

.lct-ir-dropzone.drag-active {
	border-color: var(--ir-brand);
	background: rgba(2, 110, 208, 0.1);
}

.lct-ir-dropzone input[type="file"] {
	display: none;
}

.lct-dropzone-icon {
	display: block;
	font-size: 32px;
	margin-bottom: 12px;
	line-height: 1;
	color: var(--ir-text-secondary);
}

.lct-dropzone-prompt {
	display: block;
	font-size: 0.95rem;
	font-weight: 500;
	color: var(--ir-text-primary);
	margin-bottom: 4px;
}

.lct-dropzone-sub {
	display: block;
	font-size: 0.8rem;
	color: var(--ir-text-muted);
	line-height: 1.4;
}

.lct-dropzone-status {
	display: block;
	margin-top: 8px;
	font-size: 0.8rem;
	color: var(--ir-text-secondary);
}

/* Preset chips */
.lct-ir-preset-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0 0 0;
}

.lct-ir-chip {
	padding: 6px 12px;
	border: 1px solid var(--ir-border);
	border-radius: 3px;
	font-size: 0.85rem;
	background: var(--ir-bg-white);
	color: var(--ir-text-primary);
	cursor: pointer;
	transition: all .15s;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	text-align: center;
}

.lct-ir-chip:hover {
	border-color: var(--ir-brand);
	background: var(--ir-brand-light);
	color: var(--ir-brand);
}

.lct-ir-chip.is-active {
	background: var(--ir-brand);
	color: white;
	border-color: var(--ir-brand);
}

.lct-ir-chip-label {
	display: block;
	font-weight: 500;
	font-size: 0.8rem;
}

.lct-ir-chip-dim {
	display: block;
	font-size: 0.75rem;
	opacity: 0.8;
}

.lct-ir-chip.is-active .lct-ir-chip-dim {
	opacity: 0.9;
}

.lct-ir-saved-presets {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--ir-border);
}

.lct-ir-saved-presets .lct-ir-field-label {
	display: block;
	margin-bottom: 8px;
}

.lct-ir-stats-section {
	padding: 1.5rem;
	border-top: 1px solid var(--ir-border);
}

.lct-ir-stats-section h3 {
	margin: 0 0 12px 0;
	font-size: 1.15rem !important;
	font-weight: 400 !important;
	color: var(--ir-text-primary) !important;
}

.lct-ir-image-stats,
.lct-ir-output-stats {
	font-size: 0.85rem;
	line-height: 1.6;
	color: var(--ir-text-secondary);
}

.lct-ir-image-stats > div,
.lct-ir-output-stats > div {
	margin-bottom: 4px;
}

/* Tab styling */
.lct-ir-tabs {
	display: flex;
	gap: 8px;
	border-bottom: 1px solid var(--ir-border);
	margin-bottom: 16px;
}

.lct-ir-tab {
	background: none;
	border: none;
	padding: 8px 12px;
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--ir-text-secondary);
	cursor: pointer;
	border-bottom: 2px solid transparent;
	transition: all .15s;
	margin-bottom: -1px;
}

.lct-ir-tab:hover {
	color: var(--ir-text-primary);
}

.lct-ir-tab.is-active {
	color: var(--ir-brand);
	border-bottom-color: var(--ir-brand);
}

/* Link button styling */
.lct-ir-link {
	display: inline;
	background: none;
	border: none;
	padding: 0;
	color: var(--ir-brand);
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	transition: color .15s;
}

.lct-ir-link:hover {
	color: var(--ir-brand-hover);
	text-decoration: underline;
}

/* Button styling */
.lct-ir-btn-primary,
.lct-ir-btn-secondary,
.lct-ir-btn-tertiary,
.lct-ir-reset-btn {
	padding: 8px 16px;
	border: none;
	border-radius: 3px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: all .15s;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	justify-content: center;
}

.lct-ir-btn-primary {
	background: var(--ir-brand);
	color: #fff;
}

.lct-ir-btn-primary:hover {
	background: var(--ir-brand-hover);
}

.lct-ir-btn-primary:disabled {
	background: var(--ir-border);
	color: var(--ir-text-muted);
	cursor: not-allowed;
}

.lct-ir-btn-secondary {
	background: var(--ir-border);
	color: var(--ir-text-primary);
}

.lct-ir-btn-secondary:hover {
	background: #d1d5db;
}

.lct-ir-btn-tertiary,
.lct-ir-reset-btn {
	background: transparent;
	color: var(--ir-text-muted);
	border: 1px solid var(--ir-border);
}

.lct-ir-btn-tertiary:hover,
.lct-ir-reset-btn:hover {
	background: var(--ir-brand-light);
	border-color: var(--ir-brand);
	color: var(--ir-text-primary);
}

/* Status and meta text */
.lct-ir-export-status,
.lct-ir-meta {
	margin-top: 12px;
	padding: 8px 12px;
	border-radius: 3px;
	font-size: 0.85rem;
	line-height: 1.5;
	display: none;
}

.lct-ir-export-status.visible,
.lct-ir-meta.visible {
	display: block;
}

.lct-ir-warning {
	background-color: #fef3c7;
	border: 1px solid #f59e0b;
	color: #92400e;
	padding: 12px;
	border-radius: 4px;
	margin: 12px 0;
	display: none;
}

.lct-ir-warning.is-active {
	display: block;
}

/* Privacy note */
.lct-ir-privacy-note {
	font-size: 0.75rem;
	color: var(--ir-text-muted);
	line-height: 1.5;
	margin-top: 12px;
	margin-bottom: 0;
}

/* Right sidebar styling */
.lct-ir-sidebar-right {
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 16px;
	overflow-y: auto;
}

.lct-ir-sidebar-right > * {
	margin: 0;
}

.lct-ir-sidebar-right .lct-ir-dropzone {
	margin: 0;
}

.lct-ir-sidebar-right .lct-ir-output-card {
	background: transparent;
	padding: 0;
	border: 1px solid var(--ir-border);
	border-radius: 4px;
	padding: 12px;
}

.lct-ir-sidebar-right .lct-ir-output-row {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 12px;
}

.lct-ir-sidebar-right .lct-ir-output-row > div {
	margin: 0;
}

.lct-ir-sidebar-right .lct-ir-field {
	margin: 0;
}

.lct-ir-sidebar-right .lct-ir-field.tw-mt-2 {
	margin-top: 12px;
}

.lct-ir-sidebar-right .lct-ir-export-form {
	margin: 0;
	padding: 0;
	background: transparent;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.lct-ir-sidebar-right .lct-ir-btn-primary {
	width: 100%;
	margin: 0;
	padding: 12px 16px;
	font-size: 1rem;
	justify-content: center;
}

.lct-ir-sidebar-right .lct-ir-privacy-note {
	margin: 0;
	padding: 0;
}

.lct-ir-sidebar-right .lct-ir-tertiary-actions {
	margin: 12px 0 0 0;
	padding: 12px 0 0 0;
	border-top: 1px solid var(--ir-border);
}

/* Tertiary actions */
.lct-ir-tertiary-actions {
	display: flex;
	gap: 8px;
	margin-top: 0;
	justify-content: center;
}

.lct-ir-sidebar-right .lct-ir-tertiary-actions {
	margin-top: 12px;
}

/* Preview container - center the stage */
.lct-ir-preview-main {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.lct-ir-preview-card {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
}

.lct-ir-preview-card > * {
	margin-left: auto;
	margin-right: auto;
}

/* Preview stage */
.lct-ir-stage {
	position: relative;
	background: #fafafa;
	transition: width 0.3s ease, height 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
	overflow: hidden;
}

.lct-ir-canvas {
	transition: width 0.3s ease, height 0.3s ease;
	display: block;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.lct-ir-stage-empty {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	text-align: center;
}

.lct-ir-stage-empty p {
	margin: 0;
	font-size: 0.95rem;
	color: var(--ir-text-muted);
}

/* Pixel warning notification */
#lct-ir-pixel-warning {
	font-size: 0.85rem;
	padding: 8px 12px;
	margin-bottom: 12px;
	border-radius: 4px;
	line-height: 1.4;
}

.lct-ir-zoom-row {
	margin-top: 16px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

/* Dimensions display */
.lct-ir-dim-badge {
	display: inline-block;
	font-size: 0.8rem;
	color: var(--ir-text-muted);
	font-weight: 500;
}

/* Tour header actions */
.lct-tour-header-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.lct-tour-header-actions .lct-tour-launch,
.lct-tour-header-actions .lct-product-header-docs {
	margin: 0;
	display: flex;
	align-items: center;
}

.lct-tour-header-actions .lct-product-header-docs a {
	margin: 0;
}

.lct-header-captcha-wrap {
	display: flex;
	align-items: center;
}

.lct-header-captcha-wrap .cf-turnstile {
	height: 65px;
	transform: scale(0.75);
	transform-origin: left center;
}

/* Responsive */
@media (max-width: 1023px) {
	.lct-ir-header {
		flex-direction: column;
		align-items: flex-start;
	}
	.lct-tour-header-actions {
		width: 100%;
		order: -1;
	}
}
