/**
 * Synoveo Deactivation/Deletion Modal Styles
 *
 * Extends the dashboard design system for consistent theming.
 *
 * @package Synoveo
 * @since   2.1.0
 */

/* === CSS Variables (inherit from dashboard) === */
.synoveo-modal-overlay {
	--background: 255 255 255;
	--foreground: 15 23 42;
	--muted: 241 245 249;
	--muted-foreground: 100 116 139;
	--primary: 99 102 241;
	--primary-foreground: 255 255 255;
	--border: 226 232 240;
	--destructive: 239 68 68;
	--destructive-foreground: 255 255 255;
	--warning: 245 158 11;
	--success: 34 197 94;
	--radius: 0.5rem;
	--font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* === Modal Overlay === */
.synoveo-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	font-family: var(--font-sans);
}

.synoveo-modal-overlay.is-visible {
	opacity: 1;
	visibility: visible;
}

/* === Modal Container === */
.synoveo-modal {
	background-color: rgb(var(--background));
	border-radius: var(--radius);
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	width: 100%;
	max-width: 480px;
	max-height: 90vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transform: scale(0.95);
	transition: transform 0.2s ease;
}

.synoveo-modal-overlay.is-visible .synoveo-modal {
	transform: scale(1);
}

/* === Modal Header === */
.synoveo-modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid rgb(var(--border));
}

.synoveo-modal-header-content {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
}

.synoveo-modal-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	flex-shrink: 0;
}

.synoveo-modal-icon.icon-feedback {
	background-color: rgb(var(--primary) / 0.1);
	color: rgb(var(--primary));
}

.synoveo-modal-icon.icon-warning {
	background-color: rgb(var(--warning) / 0.1);
	color: rgb(var(--warning));
}

.synoveo-modal-icon.icon-danger {
	background-color: rgb(var(--destructive) / 0.1);
	color: rgb(var(--destructive));
}

.synoveo-modal-title {
	font-size: 1.125rem;
	font-weight: 600;
	color: rgb(var(--foreground));
	margin: 0 0 0.25rem;
	line-height: 1.3;
}

.synoveo-modal-subtitle {
	font-size: 0.875rem;
	color: rgb(var(--muted-foreground));
	margin: 0;
	line-height: 1.5;
}

.synoveo-modal-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border: none;
	background: transparent;
	color: rgb(var(--muted-foreground));
	border-radius: calc(var(--radius) - 2px);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
	flex-shrink: 0;
}

.synoveo-modal-close:hover {
	background-color: rgb(var(--muted));
	color: rgb(var(--foreground));
}

/* === Modal Body === */
.synoveo-modal-body {
	padding: 1.5rem;
	overflow-y: auto;
	flex: 1;
}

/* === Feedback Reasons === */
.synoveo-feedback-reasons {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.synoveo-feedback-reason {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border: 1px solid rgb(var(--border));
	border-radius: var(--radius);
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.synoveo-feedback-reason:hover {
	background-color: rgb(var(--muted) / 0.5);
}

.synoveo-feedback-reason.is-selected {
	border-color: rgb(var(--primary));
	background-color: rgb(var(--primary) / 0.05);
}

.synoveo-feedback-reason input[type="radio"] {
	width: 1rem;
	height: 1rem;
	margin: 0;
	accent-color: rgb(var(--primary));
	cursor: pointer;
}

.synoveo-feedback-reason label {
	font-size: 0.875rem;
	color: rgb(var(--foreground));
	cursor: pointer;
	flex: 1;
}

/* === Comments Textarea === */
.synoveo-feedback-comments {
	width: 100%;
	min-height: 80px;
	padding: 0.75rem;
	border: 1px solid rgb(var(--border));
	border-radius: var(--radius);
	font-family: var(--font-sans);
	font-size: 0.875rem;
	color: rgb(var(--foreground));
	background-color: rgb(var(--background));
	resize: vertical;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.synoveo-feedback-comments:focus {
	outline: none;
	border-color: rgb(var(--primary));
	box-shadow: 0 0 0 3px rgb(var(--primary) / 0.1);
}

.synoveo-feedback-comments::placeholder {
	color: rgb(var(--muted-foreground));
}

/* === Deletion Options === */
.synoveo-deletion-options {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.synoveo-deletion-option {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 1rem;
	border: 2px solid rgb(var(--border));
	border-radius: var(--radius);
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.synoveo-deletion-option:hover {
	background-color: rgb(var(--muted) / 0.3);
}

.synoveo-deletion-option.is-selected {
	border-color: rgb(var(--primary));
	background-color: rgb(var(--primary) / 0.05);
}

.synoveo-deletion-option.option-danger.is-selected {
	border-color: rgb(var(--destructive));
	background-color: rgb(var(--destructive) / 0.05);
}

.synoveo-deletion-option input[type="radio"] {
	width: 1.125rem;
	height: 1.125rem;
	margin: 0.125rem 0 0;
	accent-color: rgb(var(--primary));
	cursor: pointer;
	flex-shrink: 0;
}

.synoveo-deletion-option.option-danger input[type="radio"] {
	accent-color: rgb(var(--destructive));
}

.synoveo-option-content {
	flex: 1;
}

.synoveo-option-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9375rem;
	font-weight: 500;
	color: rgb(var(--foreground));
	margin-bottom: 0.25rem;
	cursor: pointer;
}

.synoveo-option-label [data-lucide] {
	width: 18px;
	height: 18px;
}

.synoveo-deletion-option.option-danger .synoveo-option-label {
	color: rgb(var(--destructive));
}

.synoveo-option-desc {
	font-size: 0.8125rem;
	color: rgb(var(--muted-foreground));
	margin: 0;
	line-height: 1.4;
}

/* === Confirm Delete Input === */
.synoveo-confirm-section {
	margin-top: 1rem;
	padding: 1rem;
	background-color: rgb(var(--destructive) / 0.05);
	border: 1px solid rgb(var(--destructive) / 0.2);
	border-radius: var(--radius);
}

.synoveo-confirm-label {
	display: block;
	font-size: 0.8125rem;
	font-weight: 500;
	color: rgb(var(--destructive));
	margin-bottom: 0.5rem;
}

.synoveo-confirm-input {
	width: 100%;
	padding: 0.625rem 0.75rem;
	border: 1px solid rgb(var(--border));
	border-radius: calc(var(--radius) - 2px);
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.875rem;
	color: rgb(var(--foreground));
	background-color: rgb(var(--background));
	transition: border-color 0.15s ease;
}

.synoveo-confirm-input:focus {
	outline: none;
	border-color: rgb(var(--destructive));
}

.synoveo-confirm-input::placeholder {
	color: rgb(var(--muted-foreground));
	font-family: var(--font-sans);
}

/* === Warning Text === */
.synoveo-warning-text {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	padding: 0.75rem;
	background-color: rgb(var(--warning) / 0.1);
	border-radius: calc(var(--radius) - 2px);
	margin-bottom: 1rem;
}

.synoveo-warning-text [data-lucide] {
	width: 16px;
	height: 16px;
	color: rgb(var(--warning));
	flex-shrink: 0;
	margin-top: 0.125rem;
}

.synoveo-warning-text p {
	font-size: 0.8125rem;
	color: rgb(var(--foreground) / 0.8);
	margin: 0;
	line-height: 1.5;
}

/* === Delete List === */
.synoveo-delete-list {
	margin: 0.75rem 0;
	padding-left: 1.25rem;
}

.synoveo-delete-list li {
	font-size: 0.8125rem;
	color: rgb(var(--foreground) / 0.8);
	margin-bottom: 0.25rem;
	line-height: 1.4;
}

/* === Modal Footer === */
.synoveo-modal-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.75rem;
	padding: 1rem 1.5rem;
	border-top: 1px solid rgb(var(--border));
	background-color: rgb(var(--muted) / 0.3);
}

/* === Buttons === */
.synoveo-modal-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.625rem 1rem;
	font-family: var(--font-sans);
	font-size: 0.875rem;
	font-weight: 500;
	border-radius: calc(var(--radius) - 2px);
	cursor: pointer;
	transition: all 0.15s ease;
	border: none;
	text-decoration: none;
}

.synoveo-modal-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.synoveo-modal-btn [data-lucide] {
	width: 16px;
	height: 16px;
}

/* Secondary/Ghost button */
.synoveo-modal-btn-secondary {
	background-color: transparent;
	color: rgb(var(--muted-foreground));
	border: 1px solid rgb(var(--border));
}

.synoveo-modal-btn-secondary:hover:not(:disabled) {
	background-color: rgb(var(--muted));
	color: rgb(var(--foreground));
}

/* Primary button */
.synoveo-modal-btn-primary {
	background-color: rgb(var(--primary));
	color: rgb(var(--primary-foreground));
}

.synoveo-modal-btn-primary:hover:not(:disabled) {
	background-color: rgb(79 82 221);
}

/* Danger button */
.synoveo-modal-btn-danger {
	background-color: rgb(var(--destructive));
	color: rgb(var(--destructive-foreground));
}

.synoveo-modal-btn-danger:hover:not(:disabled) {
	background-color: rgb(220 50 50);
}

/* === Loading State === */
.synoveo-modal-btn.is-loading {
	position: relative;
	color: transparent;
}

.synoveo-modal-btn.is-loading::after {
	content: '';
	position: absolute;
	width: 1rem;
	height: 1rem;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: synoveo-spin 0.6s linear infinite;
}

.synoveo-modal-btn-primary.is-loading::after {
	border-color: rgb(var(--primary-foreground));
	border-right-color: transparent;
}

.synoveo-modal-btn-danger.is-loading::after {
	border-color: rgb(var(--destructive-foreground));
	border-right-color: transparent;
}

@keyframes synoveo-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

/* === Lucide Icons === */
.synoveo-modal-overlay [data-lucide] {
	display: inline-flex;
	vertical-align: middle;
	flex-shrink: 0;
}

/* === Data Choice Section (in deactivation modal) === */
.synoveo-data-choice-section {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid rgb(var(--border));
}

.synoveo-section-label {
	font-size: 0.8125rem;
	font-weight: 500;
	color: rgb(var(--muted-foreground));
	margin: 0 0 0.75rem;
}

.synoveo-data-choice {
	padding: 0.875rem 1rem;
	background-color: rgb(var(--destructive) / 0.03);
	border: 1px solid rgb(var(--destructive) / 0.15);
	border-radius: var(--radius);
}

.synoveo-checkbox-label {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	cursor: pointer;
}

.synoveo-checkbox-label input[type="checkbox"] {
	width: 1rem;
	height: 1rem;
	margin: 0;
	accent-color: rgb(var(--destructive));
	cursor: pointer;
	flex-shrink: 0;
}

.synoveo-checkbox-text {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: rgb(var(--destructive));
}

.synoveo-checkbox-text [data-lucide] {
	width: 14px;
	height: 14px;
}

.synoveo-checkbox-desc {
	font-size: 0.75rem;
	color: rgb(var(--muted-foreground));
	margin: 0.375rem 0 0 1.625rem;
	line-height: 1.4;
}

/* === Responsive === */
@media (max-width: 540px) {
	.synoveo-modal {
		max-width: calc(100% - 2rem);
		margin: 1rem;
	}

	.synoveo-modal-header {
		padding: 1rem;
	}

	.synoveo-modal-body {
		padding: 1rem;
	}

	.synoveo-modal-footer {
		padding: 1rem;
		flex-direction: column;
	}

	.synoveo-modal-btn {
		width: 100%;
	}
}
