/* KaiGen Plugin Admin Styles */

/* ===== MODAL HEADER STYLING ===== */

/* Center the logo in KaiGen modal header */
.kaigen-modal .components-modal__header .components-modal__header-heading {
	width: 100%;
}

.kaigen-modal__logo-container {
	display: flex;
	justify-content: center;
	width: 100%;
}

.kaigen-modal__logo {
	height: 80px;
	width: auto;
}

/* ===== INPUT CONTAINER ===== */

.kaigen-modal__input-container {
	display: flex;
	align-items: center;
	gap: 8px;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 8px;
}

/* ===== TEXTAREA ===== */

.kaigen-modal__textarea-container {
	flex: 1;
}

.kaigen-modal__textarea .components-textarea-control__input {
	width: 100%;
	resize: none;
	border: none;
	box-shadow: none;
	outline: none;
}

/* ===== BUTTONS ===== */

.kaigen-modal__ref-button,
.kaigen-modal__settings-button,
.kaigen-modal__submit-button {
	width: 40px;
	height: 40px;
	min-width: 40px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.kaigen-modal__settings-button {
	background: #f0f0f0;
}

/* Reference button icon styling */
.kaigen-modal__ref-button .dashicon {
	font-size: 18px;
}

/* Settings button icon styling */
.kaigen-modal__settings-button .dashicon {
	color: #555;
	font-size: 18px;
}

/* ===== SUBMIT BUTTON ===== */

.kaigen-modal__submit-container {
	display: none; /* Hide the separate container since button is now inline */
}

.kaigen-modal__submit-button {
	background: #007cba;
	color: #fff;
	border: 1px solid #007cba;
}

/* ===== GENERATION PROGRESS ===== */

.kaigen-modal__progress {
	margin-top: 12px;
}

.kaigen-modal__progress-label {
	font-size: 12px;
	color: #555;
	margin-bottom: 6px;
}

.kaigen-modal__progress-track {
	height: 6px;
	background: #e9eef0;
	border-radius: 999px;
	overflow: hidden;
	border: 1px solid #c3c4c7;
}

.kaigen-modal__progress-fill {
	height: 100%;
	width: 0;
	background: #007cba;
	transition: width 0.2s linear;
}

.kaigen-generation-meta-loading {
	margin: 8px 0 0 0;
	color: #666;
	font-size: 12px;
}

.kaigen-generation-meta-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 8px;
	font-size: 12px;
}

.kaigen-generation-meta-table th,
.kaigen-generation-meta-table td {
	text-align: left;
	padding: 4px 0;
	vertical-align: top;
}

.kaigen-generation-meta-table th {
	width: 90px;
	color: #555;
	font-weight: 600;
}

.kaigen-generation-meta-images {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.kaigen-generation-meta-image {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid #ccd0d4;
}

.kaigen-progress-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
}

.kaigen-progress-icon__track {
	width: 20px;
	height: 6px;
	background: #e9eef0;
	border-radius: 999px;
	overflow: hidden;
	border: 1px solid #c3c4c7;
}

.kaigen-progress-icon__fill {
	display: block;
	height: 100%;
	width: 0;
	background: #007cba;
	transition: width 0.2s linear;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

@media (max-width: 600px) {

	.kaigen-modal__logo {
		height: 60px;
	}

	.kaigen-modal__input-container {
		gap: 6px;
	}

	.kaigen-modal__ref-button,
	.kaigen-modal__settings-button,
	.kaigen-modal__submit-button {
		width: 36px;
		height: 36px;
		min-width: 36px;
	}
}

.kaigen-modal__aspect-ratio-button {
	cursor: pointer;
	padding: 8px;
	width: 75px;
	height: 60px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	border-radius: 4px;
	border: 1px solid #ccd0d4;
	background: #fff;
}

.kaigen-modal__aspect-ratio-button-selected {
	border: 2px solid #007cba;
	background: #f0f8ff;
}

.kaigen-modal__quality-button {
	cursor: pointer;
	padding: 6px 10px;
	border-radius: 4px;
	border: 1px solid #ccd0d4;
	background: #fff;
	font-size: 12px;
}

.kaigen-modal__quality-button-selected {
	border: 2px solid #007cba;
	background: #f0f8ff;
}

/* ===== NEW STYLES ===== */

.kaigen-hidden {
	display: none;
}

.kaigen-warning {
	margin: 10px 0;
}

.kaigen-toolbar-icon {
	width: 24px;
}

.kaigen-modal-logo {
	height: 80px;
	width: auto;
	display: block;
}

.kaigen-error-text {
	color: #f00;
}

/* ===== KAIGEN BUTTON CONTEXT STYLES ===== */

/* Placeholder button (for editor canvas) - shown by default */
.kaigen-placeholder-button {
	padding: 0;
	background: transparent;
	border: none;
	box-shadow: none;
	min-width: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	order: 99;
}

/* Menu item button (for dropdown) - hidden by default, must be specific to
 * override WP styles */
button.components-button.components-menu-item__button.is-next-40px-default-size.kaigen-menu-item-button {
	display: none;
}

/* In popover context: hide placeholder button, show menu item button */
.components-popover .kaigen-placeholder-button {
	display: none;
}

.components-popover button.components-button.components-menu-item__button.is-next-40px-default-size.kaigen-menu-item-button {
	display: flex;
}

.kaigen-ref-button-selected {
	background: #007cba;
}

.kaigen-ref-button-icon-selected {
	color: #fff;
}

.kaigen-text-center {
	text-align: center;
}

.kaigen-modal-dropdown-content-container {
	padding: 8px;
	width: 300px;
}

.kaigen-modal-dropdown-content-title {
	margin: 0 0 8px 0;
}

.kaigen-modal-reference-images-container {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	max-height: 200px;
	overflow-y: auto;
}

.kaigen-modal-reference-image {
	width: 60px;
	height: 60px;
	padding: 0;
	margin: 0;
	border: 3px solid transparent;
	border-radius: 4px;
	background: transparent;
	cursor: pointer;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.kaigen-modal-reference-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.kaigen-modal-reference-image-selected {
	border: 3px solid #007cba;
}

.kaigen-modal-no-references {
	color: #757575;
	font-size: 13px;
	margin: 0;
	padding: 8px 0;
}

.kaigen-modal-aspect-ratio-container {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.kaigen-modal-quality-container {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 8px;
}

.kaigen-modal-aspect-ratio-icon-container {
	width: 40px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.kaigen-modal-aspect-ratio-icon {
	background: #e9eef0;
	border: 1px solid #c3c4c7;
	border-radius: 2px;
}

.kaigen-modal-aspect-ratio-icon-selected {
	background: #007cba;
}

.kaigen-modal-aspect-ratio-label {
	font-size: 11px;
	color: #555;
}

.kaigen-aspect-ratio-1-1 {
	width: 30px;
	height: 30px;
}

.kaigen-aspect-ratio-16-9 {
	width: 34px;
	height: 19px;
}

.kaigen-aspect-ratio-9-16 {
	width: 19px;
	height: 34px;
}

.kaigen-aspect-ratio-4-3 {
	width: 34px;
	height: 25px;
}

.kaigen-aspect-ratio-3-4 {
	width: 25px;
	height: 34px;
}
