/* =========================================================
   Flip Image Tool — styles
   Every rule is scoped under .wpfit-flip-tool-wrapper so this
   plugin can never bleed into (or be overridden unexpectedly
   by) the active theme or other plugins.

   Colour-bearing declarations carry !important. Many WordPress
   themes ship their own button/link colour rules at equal or
   higher specificity (e.g. "a, button { color: ... }" or
   theme-specific ".btn" classes), and those can silently win
   over a plain class selector even though this stylesheet is
   scoped. !important plus loading this file after the theme's
   stylesheet (see wp_enqueue_scripts priority in the main
   plugin file) guarantees the theme colour below always applies.
   ========================================================= */

.wpfit-flip-tool-wrapper,
.wpfit-flip-tool-wrapper * {
	box-sizing: border-box;
}

.wpfit-flip-tool-wrapper {
	/* Your theme colour */
	--wpfit-primary: #1e73be;
	--wpfit-primary-light: #3d8fd6;
	--wpfit-border: #e5e7f0;
	--wpfit-bg-soft: #eaf3fb;
	--wpfit-text: #1a1a2e;
	--wpfit-text-muted: #7a7f95;

	display: flex;
	align-items: flex-start;
	gap: 32px;
	width: 100% !important;
	max-width: 100% !important;
	margin: 24px 0;
	padding: 24px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.4;
	color: var(--wpfit-text) !important;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 16px;
}

.wpfit-flip-tool-wrapper img {
	max-width: none; /* neutralize theme "img { max-width:100% }" side effects inside canvas preview only where needed */
}

/* ---------- Sidebar ---------- */

.wpfit-flip-tool-wrapper .wpfit-sidebar {
	width: 240px;
	flex: 0 0 240px;
}

.wpfit-flip-tool-wrapper .wpfit-title {
	margin: 0 0 20px;
	font-size: 22px;
	font-weight: 700;
	color: var(--wpfit-text) !important;
}

.wpfit-flip-tool-wrapper .wpfit-upload-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin: 0;
	padding: 13px 18px;
	background: linear-gradient(135deg, var(--wpfit-primary-light), var(--wpfit-primary)) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(30, 115, 190, 0.28);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wpfit-flip-tool-wrapper .wpfit-upload-btn:hover,
.wpfit-flip-tool-wrapper .wpfit-upload-btn:focus,
.wpfit-flip-tool-wrapper .wpfit-upload-btn:active,
.wpfit-flip-tool-wrapper .wpfit-upload-btn:visited {
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(30, 115, 190, 0.38);
}

.wpfit-flip-tool-wrapper .wpfit-upload-icon svg {
	width: 18px;
	height: 18px;
	display: block;
}

.wpfit-flip-tool-wrapper .wpfit-flip-buttons {
	display: flex;
	gap: 12px;
	margin-top: 22px;
}

.wpfit-flip-tool-wrapper .wpfit-flip-btn {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 18px 8px;
	background: #fff !important;
	border: 2px solid var(--wpfit-border) !important;
	border-radius: 12px;
	font-size: 13px;
	color: #444 !important;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.wpfit-flip-tool-wrapper .wpfit-flip-btn svg {
	width: 24px;
	height: 24px;
	display: block;
}

.wpfit-flip-tool-wrapper .wpfit-flip-btn:hover:not(:disabled) {
	border-color: #7fb2de !important;
	background: var(--wpfit-bg-soft) !important;
}

.wpfit-flip-tool-wrapper .wpfit-flip-btn.wpfit-active {
	border-color: var(--wpfit-primary) !important;
	background: var(--wpfit-bg-soft) !important;
	color: var(--wpfit-primary) !important;
}

.wpfit-flip-tool-wrapper .wpfit-flip-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.wpfit-flip-tool-wrapper .wpfit-reset-btn {
	display: block;
	width: 100%;
	margin-top: 14px;
	padding: 10px;
	background: #fff !important;
	border: 1px solid var(--wpfit-border) !important;
	border-radius: 8px;
	color: var(--wpfit-text-muted) !important;
	font-size: 14px;
	cursor: pointer;
}

.wpfit-flip-tool-wrapper .wpfit-reset-btn:hover {
	background: #f7f7fa !important;
	color: #444 !important;
}

.wpfit-flip-tool-wrapper .wpfit-download-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin-top: 22px;
	padding: 13px 18px;
	background: linear-gradient(135deg, var(--wpfit-primary-light), var(--wpfit-primary)) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.wpfit-flip-tool-wrapper .wpfit-download-btn svg {
	width: 18px;
	height: 18px;
	display: block;
}

.wpfit-flip-tool-wrapper .wpfit-download-btn:not(:disabled):hover,
.wpfit-flip-tool-wrapper .wpfit-download-btn:not(:disabled):focus,
.wpfit-flip-tool-wrapper .wpfit-download-btn:not(:disabled):active {
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(30, 115, 190, 0.38);
}

.wpfit-flip-tool-wrapper .wpfit-download-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
}

/* ---------- Preview area ---------- */
/* flex: 2 (vs. the fixed 240px sidebar) so the image box claims
   the lion's share of the wrapper's now-full-bleed width. */

.wpfit-flip-tool-wrapper .wpfit-preview-area {
	flex: 2 1 0%;
	min-width: 0;
	min-height: 620px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 28px;
	background: #fafafa;
	border: 1px solid #eee;
	border-radius: 14px;
}

.wpfit-flip-tool-wrapper .wpfit-dropzone {
	width: 100%;
	height: 100%;
	min-height: 560px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 40px;
	text-align: center;
	color: #9aa0b4 !important;
	background: transparent;
	border: 2px dashed #d5d8e5 !important;
	border-radius: 10px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.wpfit-flip-tool-wrapper .wpfit-dropzone svg {
	width: 46px;
	height: 46px;
	opacity: 0.55;
}

.wpfit-flip-tool-wrapper .wpfit-dropzone p {
	margin: 0;
	max-width: 260px;
	font-size: 14px;
}

.wpfit-flip-tool-wrapper .wpfit-dropzone.wpfit-dragover {
	border-color: var(--wpfit-primary) !important;
	background: var(--wpfit-bg-soft) !important;
	color: var(--wpfit-primary) !important;
}

.wpfit-flip-tool-wrapper .wpfit-canvas {
	max-width: 100%;
	max-height: 820px;
	width: auto;
	height: auto;
	border-radius: 8px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
	.wpfit-flip-tool-wrapper {
		flex-direction: column;
		padding: 16px;
	}

	.wpfit-flip-tool-wrapper .wpfit-sidebar {
		width: 100%;
		flex-basis: auto;
	}

	.wpfit-flip-tool-wrapper .wpfit-preview-area {
		width: 100%;
		min-height: 380px;
	}

	.wpfit-flip-tool-wrapper .wpfit-dropzone {
		min-height: 320px;
	}
}
