/**
 * Admin Widget Manager Styles
 * 
 * Styles for the V-Tech Studio Widget Manager admin page.
 * 
 * @package VTechStudioWidgets
 * @since 1.0.0
 */

/* Admin Page Container */
.vtechst-widget-manager {
	max-width: 1200px;
}

/* Admin Header */
.vtechst-admin-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 20px 0;
	padding: 20px;
	background: #fff;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.vtechst-admin-actions {
	display: flex;
	gap: 10px;
	align-items: center;
}

.vtechst-admin-status {
	display: flex;
	align-items: center;
}

.vtechst-status-message {
	padding: 8px 12px;
	border-radius: 4px;
	font-weight: 500;
	display: none;
}

.vtechst-status-message.success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.vtechst-status-message.error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* Category Sections */
.vtechst-category-section {
	margin-bottom: 40px;
}

.vtechst-category-title {
	font-size: 18px;
	font-weight: 600;
	color: #1d2327;
	margin: 0 0 20px 0;
	padding-bottom: 10px;
	border-bottom: 2px solid #f0f0f1;
}

.vtechst-category-count {
	font-size: 14px;
	font-weight: 400;
	color: #646970;
}

/* Widgets Grid */
.vtechst-widgets-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
	gap: 20px;
}

/* Widget Cards */
.vtechst-widget-card {
	background: #fff;
	border: 1px solid #ccd0d4;
	border-radius: 8px;
	padding: 20px;
	transition: all 0.3s ease;
	position: relative;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.vtechst-widget-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	transform: translateY(-2px);
}

.vtechst-widget-card.active {
	border-color: #00a32a;
	background: #f0f6fc;
}

.vtechst-widget-card.inactive {
	border-color: #dcdcde;
	background: #f9f9f9;
}

.vtechst-widget-card.disabled {
	opacity: 0.6;
	background: #f6f7f7;
	border-color: #dcdcde;
}

/* Widget Header */
.vtechst-widget-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 15px;
}

.vtechst-widget-title h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #1d2327;
	line-height: 1.4;
}

.vtechst-requirement-badge {
	display: inline-block;
	background: #f0b849;
	color: #8a6914;
	font-size: 11px;
	font-weight: 500;
	padding: 2px 6px;
	border-radius: 3px;
	margin-top: 5px;
}

/* Toggle Switch */
.vtechst-widget-toggle {
	flex-shrink: 0;
	margin-left: 15px;
}

.vtechst-toggle-switch {
	position: relative;
	display: inline-block;
	width: 50px;
	height: 24px;
}

.vtechst-toggle-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.vtechst-toggle-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #ccc;
	transition: 0.3s;
	border-radius: 24px;
}

.vtechst-toggle-slider:before {
	position: absolute;
	content: "";
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: 0.3s;
	border-radius: 50%;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.vtechst-toggle-switch input:checked + .vtechst-toggle-slider {
	background-color: #00a32a;
}

.vtechst-toggle-switch input:checked + .vtechst-toggle-slider:before {
	transform: translateX(26px);
}

.vtechst-toggle-switch input:disabled + .vtechst-toggle-slider {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Widget Body */
.vtechst-widget-body {
	margin-top: 15px;
}

.vtechst-widget-description {
	margin: 0 0 15px 0;
	color: #646970;
	font-size: 14px;
	line-height: 1.5;
}

.vtechst-widget-meta {
	display: flex;
	flex-direction: column;
	gap: 5px;
	font-size: 12px;
	color: #8c8f94;
}

.vtechst-widget-version {
	font-weight: 500;
}

.vtechst-widget-requirements {
	font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
	.vtechst-admin-header {
		flex-direction: column;
		gap: 15px;
		align-items: stretch;
	}
	
	.vtechst-admin-actions {
		justify-content: center;
		flex-wrap: wrap;
	}
	
	.vtechst-widgets-grid {
		grid-template-columns: 1fr;
	}
	
	.vtechst-widget-header {
		flex-direction: column;
		gap: 10px;
	}
	
	.vtechst-widget-toggle {
		margin-left: 0;
		align-self: flex-start;
	}
}

@media (max-width: 480px) {
	.vtechst-widget-card {
		padding: 15px;
	}
	
	.vtechst-admin-actions {
		flex-direction: column;
	}
	
	.vtechst-admin-actions .button {
		width: 100%;
		justify-content: center;
	}
}

/* Loading States */
.vtechst-widget-manager.loading .vtechst-widget-card {
	opacity: 0.7;
	pointer-events: none;
}

.vtechst-widget-manager.loading .vtechst-admin-actions .button {
	opacity: 0.7;
	pointer-events: none;
}

/* Animation for status messages */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.vtechst-status-message.show {
	display: block;
	animation: fadeInUp 0.3s ease;
}

/* Focus states for accessibility */
.vtechst-toggle-switch input:focus + .vtechst-toggle-slider {
	box-shadow: 0 0 0 2px #0073aa;
}

.vtechst-widget-card:focus-within {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.vtechst-widget-card {
		border-width: 2px;
	}
	
	.vtechst-widget-card.active {
		border-color: #000;
	}
	
	.vtechst-toggle-slider {
		border: 2px solid #000;
	}
}
