/**
 * Scheduled Posts Showcase - Admin Styles
 *
 * Styles for the settings page and admin notices.
 *
 * @package Scheduled_Posts_Showcase
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
	--sps-brand: #0073aa;
}

/* ==========================================================================
   Settings Page Layout
   ========================================================================== */

.sps-settings-wrap {
	max-width: 1200px;
}

.sps-settings-container {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-top: 20px;
}

.sps-settings-main {
	flex: 1;
	min-width: 500px;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	padding: 20px;
}

.sps-settings-sidebar {
	width: 300px;
	flex-shrink: 0;
}

/* ==========================================================================
   Settings Form
   ========================================================================== */

.sps-settings-main h2 {
	margin-top: 2em;
	padding-top: 1em;
	border-top: 1px solid #ddd;
}

.sps-settings-main h2:first-of-type {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}

.sps-settings-main .form-table th {
	width: 200px;
	padding-top: 15px;
	padding-bottom: 15px;
}

.sps-settings-main .form-table td {
	padding-top: 10px;
	padding-bottom: 10px;
}

/* ==========================================================================
   Conditional Fields
   ========================================================================== */

.sps-conditional-field {
	transition: opacity 0.2s ease;
}

.sps-conditional-field.sps-hidden {
	display: none;
}

/* ==========================================================================
   Icon Selector
   ========================================================================== */

.sps-icon-selector {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

.sps-icon-option {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 2px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.15s ease;
}

.sps-icon-option:hover {
	border-color: #0073aa;
	background: #f0f6fc;
}

.sps-icon-option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.sps-icon-option .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
	color: #50575e;
}

/* Selected state */
.sps-icon-option.selected,
.sps-icon-option:has(input:checked) {
	border-color: #0073aa;
	background: #f0f6fc;
}

.sps-icon-option.selected .dashicons,
.sps-icon-option:has(input:checked) .dashicons {
	color: #0073aa;
}

/* ==========================================================================
   Color Picker
   ========================================================================== */

.sps-color-picker {
	max-width: 100px;
}

/* ==========================================================================
   Promotional widgets - Sidebar layout (vertical)
   ========================================================================== */

/* Individual widget box */
.sps-sidebar-widget {
	background: #fff;
	border: 1px solid #c3c4c7;
	padding: 15px;
	margin-bottom: 20px;
}

.sps-sidebar-widget:last-child {
	margin-bottom: 0;
}

.sps-sidebar-widget h3 {
	margin-top: 0;
	margin-bottom: 10px;
	padding-bottom: 10px;
	border-bottom: 1px solid #eee;
	font-size: 13px;
	font-weight: 600;
}

.sps-sidebar-widget p {
	margin: 0 0 15px;
	color: #50575e;
	font-size: 13px;
	line-height: 1.5;
}

/* Promo widgets with icons */
.sps-promo-widget > .dashicons {
	font-size: 24px;
	width: 24px;
	height: 24px;
	color: var(--sps-brand, #0073aa);
	margin-bottom: 10px;
}

/* Full-width buttons */
.sps-promo-widget .button {
	margin-top: 5px;
	width: 100%;
	text-align: center;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
	.sps-settings-container {
		flex-direction: column;
	}

	.sps-settings-main {
		min-width: auto;
	}

	.sps-settings-sidebar {
		width: 100%;
	}
}

@media (max-width: 600px) {
	.sps-settings-main .form-table th {
		width: auto;
		display: block;
		padding-bottom: 5px;
	}

	.sps-settings-main .form-table td {
		display: block;
		padding-top: 0;
	}
}

/* ==========================================================================
   Widget Form Styles (Legacy Widget in Block Editor)
   ========================================================================== */

/* Widget icon selector grid */
.sps-widget-icons {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 5px;
}

.sps-widget-icon-option {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 1px solid #ddd;
	border-radius: 3px;
	cursor: pointer;
	transition: border-color 0.15s;
}

.sps-widget-icon-option:hover {
	border-color: #0073aa;
}

.sps-widget-icon-option:has(input:checked) {
	border-color: #0073aa;
	background: #f0f6fc;
}

.sps-widget-icon-option .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* Ensure textareas in widget have visible borders */
.widget [id*="sps_scheduled_posts"] textarea,
.widget-content textarea[id*="sps_scheduled_posts"] {
	width: 100%;
	border: 1px solid #8c8f94;
	border-radius: 4px;
	padding: 8px;
	font-family: inherit;
	font-size: 13px;
	resize: vertical;
	min-height: 60px;
}

.widget [id*="sps_scheduled_posts"] textarea:focus,
.widget-content textarea[id*="sps_scheduled_posts"]:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}