/**
 * Form Container - Editor Only Styles
 * Style identique au front-end pour une prévisualisation fidèle
 */

.giraforms-form-container {
	max-width: 100%;
	margin: 0 auto;
}

.giraforms-form-header {
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 1px solid var(--giraforms-border-color, #ddd);
}

.giraforms-form-header h3 {
	margin: 0 0 5px 0;
	color: var(--giraforms-text-color);
	font-size: 18px;
	font-weight: 600;
}

.giraforms-form-id {
	margin: 0;
	color: #757575;
	font-size: 12px;
	font-family: monospace;
}

.giraforms-form-inner {
	padding: 0;
}

/* Style pour les blocks imbriqués */
.giraforms-form-inner .block-editor-block-list__layout {
	margin: 0;
}

.giraforms-form-inner .block-editor-block-list__block {
	margin-top: 0;
	margin-bottom: 1.5rem;
}

/* Appender button */
.giraforms-form-inner .block-list-appender {
	margin-top: 1rem;
}

/* Readonly field styling in inspector */
.giraforms-readonly-field input {
	background-color: #f0f0f0 !important;
	cursor: not-allowed !important;
	opacity: 0.7;
}

/* Invalid URL warning styling */
.giraforms-invalid-url input {
	border-color: #d63638 !important;
	box-shadow: 0 0 0 1px #d63638 !important;
}

.giraforms-invalid-url .components-base-control__help {
	color: #d63638;
	font-weight: 500;
}

/* =============================================
   Template Placeholder (shown when block is empty)
   ============================================= */

.giraforms-template-placeholder {
	min-height: 200px;
}

.giraforms-template-placeholder .components-placeholder__label {
	color: #1e1e1e;
	font-size: 18px;
	font-weight: 600;
}

.giraforms-template-placeholder .components-placeholder__instructions {
	color: #757575;
	font-size: 13px;
	margin-bottom: 16px;
}

.giraforms-template-picker {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
}

/* Quick template buttons grid */
.giraforms-quick-templates {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	width: 100%;
	max-width: 480px;
}

@media (min-width: 600px) {
	.giraforms-quick-templates {
		grid-template-columns: repeat(4, 1fr);
	}
}

.giraforms-quick-template-btn {
	display: flex !important;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 16px 12px !important;
	border: 1px solid #ddd !important;
	border-radius: 8px !important;
	background: #fff !important;
	cursor: pointer;
	transition: all 0.2s;
	min-height: 80px;
	justify-content: center;
}

.giraforms-quick-template-btn:hover {
	border-color: #385aea !important;
	background: #f0f6fc !important;
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(56, 90, 234, 0.15);
}

.giraforms-quick-template-btn .dashicon,
.giraforms-quick-template-btn .dashicons {
	color: #385aea;
	font-size: 24px;
	width: 24px;
	height: 24px;
}

.giraforms-quick-template-label {
	font-size: 12px;
	font-weight: 500;
	color: #1e1e1e;
	text-align: center;
	line-height: 1.3;
}

/* Action buttons row */
.giraforms-template-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
}

/* =============================================
   Template Library Modal
   ============================================= */

.giraforms-template-modal .components-modal__content {
	padding: 0;
}

.giraforms-modal-content {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 24px;
}

/* Category filter tabs */
.giraforms-modal-categories {
	display: flex;
	gap: 8px;
	margin-bottom: 24px;
	flex-wrap: wrap;
	padding-bottom: 16px;
	border-bottom: 1px solid #e0e0e0;
}

.giraforms-category-btn {
	padding: 8px 16px !important;
	border-radius: 20px !important;
	border: 1px solid #ddd !important;
	background: #fff !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	color: #1e1e1e !important;
	cursor: pointer;
	transition: all 0.2s;
}

.giraforms-category-btn:hover {
	border-color: #385aea !important;
	color: #385aea !important;
}

.giraforms-category-btn.is-active {
	background: #385aea !important;
	border-color: #385aea !important;
	color: #fff !important;
}

/* Templates grid */
.giraforms-modal-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	overflow-y: auto;
	flex: 1;
}

/* Template card */
.giraforms-modal-card {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 20px;
	background: #fff;
	display: flex;
	flex-direction: column;
	transition: all 0.2s;
}

.giraforms-modal-card:hover {
	border-color: #385aea;
	box-shadow: 0 4px 12px rgba(56, 90, 234, 0.12);
	transform: translateY(-2px);
}

.giraforms-modal-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.giraforms-modal-card-header .dashicon,
.giraforms-modal-card-header .dashicons {
	color: #385aea;
	font-size: 32px;
	width: 32px;
	height: 32px;
}

.giraforms-badge-columns {
	font-size: 11px;
	font-weight: 600;
	color: #385aea;
	background: #f0f6fc;
	padding: 3px 8px;
	border-radius: 10px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.giraforms-modal-card-title {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 8px 0;
	color: #1e1e1e;
}

.giraforms-modal-card-desc {
	font-size: 13px;
	color: #757575;
	margin: 0 0 12px 0;
	line-height: 1.5;
	flex: 1;
}

.giraforms-modal-card-meta {
	font-size: 12px;
	color: #949494;
	margin-bottom: 12px;
}

.giraforms-modal-card-btn {
	width: 100%;
	justify-content: center !important;
}
