/**
 * Shared Styles for 3D Scan & Show Plugin
 * 
 * This file contains reusable components used across multiple pages:
 * - CSS Variables
 * - Form Styles
 * - Button Styles
 * - Card Base Styles
 * - Notice/Message Styles
 * - Loading States
 * - Modal Styles
 * - SPA Layout (Header, Navigation, Content Container)
 */

/* ==========================================================================
   CSS VARIABLES
   ========================================================================== */

:root {
	--stw-primary: #10b981;
	--stw-primary-dark: #059669;
	--stw-dark: #1f2937;
	--stw-darker: #111827;
	--stw-gray: #6b7280;
	--stw-light-gray: #f3f4f6;
	--stw-border: #e5e7eb;
	--stw-radius: 8px;
	--stw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1),
		0 1px 2px -1px rgba(0, 0, 0, 0.1);
	--stw-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
		0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   FORM STYLES
   ========================================================================== */

.stw-form-group {
	margin-bottom: 20px;
}

.stw-form-group label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
	color: var(--stw-dark);
	font-size: 14px;
}

.stw-form-group small {
	font-size: 12px;
	color: var(--stw-gray);
	margin-top: 6px;
	display: block;
}

.stw-form-group input,
.stw-form-group textarea,
.stw-form-group select {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--stw-border);
	border-radius: var(--stw-radius);
	font-size: 14px;
	font-family: inherit;
	background: white;
	transition: all 0.2s;
}

.stw-form-group input:focus,
.stw-form-group textarea:focus,
.stw-form-group select:focus {
	outline: none;
	border-color: var(--stw-primary);
	box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.stw-form-group textarea {
	resize: vertical;
	min-height: 120px;
}

/* ==========================================================================
   BUTTON STYLES
   ========================================================================== */

.button,
.button-primary,
.button-secondary,
.stw-button {
	padding: 10px 20px;
	border-radius: var(--stw-radius);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-decoration: none;
	border: 1px solid;
}

.button-primary {
	background: var(--stw-primary);
	border-color: var(--stw-primary);
	color: white;
}

.button-primary:hover,
.button-primary:focus {
	background: var(--stw-primary-dark);
	border-color: var(--stw-primary-dark);
	color: white;
	transform: translateY(-1px);
	box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.button-secondary {
	background: white;
	border-color: var(--stw-border);
	color: var(--stw-dark);
}

.button-secondary:hover,
.button-secondary:focus {
	background: var(--stw-light-gray);
	border-color: var(--stw-primary);
	color: var(--stw-primary);
}

.button-large {
	padding: 12px 24px;
	font-size: 15px;
}

.button-small {
	padding: 6px 12px;
	font-size: 13px;
}

/* ==========================================================================
   CARD BASE STYLES
   ========================================================================== */

.stw-card,
.stw-settings-card,
.stw-step-card,
.stw-contact-card {
	background: white;
	border: 1px solid var(--stw-border);
	border-radius: var(--stw-radius);
	box-shadow: var(--stw-shadow);
}

/* ==========================================================================
   GENERAL UTILITIES
   ========================================================================== */

.stw-admin-content {
	max-width: 100%;
	padding: 0 20px;
}

.stw-dashboard-wrap {
	margin-right: 20px;
}

/* ==========================================================================
   LOADING STATES
   ========================================================================== */

.loading {
	color: var(--stw-gray);
	font-style: italic;
	animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

/* ==========================================================================
   NOTICE/MESSAGE STYLES
   ========================================================================== */

.notice {
	margin: 16px 0;
	padding: 14px 16px;
	border-left: 4px solid;
	border-radius: var(--stw-radius);
	font-size: 14px;
}

.notice-success {
	background: #d1fae5;
	border-color: var(--stw-primary);
	color: var(--stw-primary-dark);
}

.notice-error {
	background: #fee2e2;
	border-color: #dc2626;
	color: #991b1b;
}

/* ==========================================================================
   STATUS BADGES
   ========================================================================== */

.stw-status {
	display: inline-block;
	padding: 5px 12px;
	border-radius: 16px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.stw-status-publish {
	background: #d1fae5;
	color: var(--stw-primary-dark);
}

.stw-status-draft {
	background: var(--stw-light-gray);
	color: var(--stw-gray);
}

.stw-status-archived {
	background: #fef3c7;
	color: #92400e;
}

/* ==========================================================================
   LINK STYLES
   ========================================================================== */

.stw-link {
	color: var(--stw-primary);
	text-decoration: none;
	font-size: 15px;
	display: flex;
	align-items: center;
	font-weight: 500;
}

.stw-link:hover {
	color: var(--stw-primary-dark);
	text-decoration: underline;
}

/* ==========================================================================
   MODAL STYLES
   ========================================================================== */

#stw-items-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.modal-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.75);
	backdrop-filter: blur(2px);
}

.modal-content {
	position: relative;
	background: white;
	padding: 32px;
	border-radius: 12px;
	max-width: 900px;
	width: 90%;
	max-height: 85vh;
	overflow-y: auto;
	box-shadow:
		0 20px 25px -5px rgba(0, 0, 0, 0.1),
		0 10px 10px -5px rgba(0, 0, 0, 0.04);
	z-index: 100001;
}

.modal-content h2 {
	margin: 0 0 24px 0;
	color: var(--stw-dark);
	font-size: 22px;
	font-weight: 600;
}

.stw-items-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 16px;
	margin: 20px 0;
}

.stw-item-card {
	border: 2px solid var(--stw-border);
	border-radius: var(--stw-radius);
	padding: 16px;
	text-align: center;
	cursor: pointer;
	transition: all 0.2s;
	background: white;
}

.stw-item-card:hover {
	border-color: var(--stw-primary);
	box-shadow: var(--stw-shadow);
	transform: translateY(-2px);
}

.stw-item-card img {
	width: 100%;
	height: 140px;
	object-fit: cover;
	border-radius: var(--stw-radius);
	margin-bottom: 12px;
}

.stw-item-card h4 {
	margin: 10px 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--stw-dark);
}

.stw-item-card .button {
	width: 100%;
}

/* ==========================================================================
   SPA LAYOUT - HEADER, NAVIGATION, CONTENT CONTAINER
   ========================================================================== */

.stw-plugin-wrap {
	margin: 0;
	padding: 0;
	background: #f9fafb;
}

.stw-plugin-header {
	background: linear-gradient(
		135deg,
		var(--stw-darker) 0%,
		var(--stw-dark) 100%
	);
	padding: 24px 32px;
	margin: 0 -20px 24px -20px;
	box-shadow: var(--stw-shadow);
}

.stw-plugin-title h1 {
	margin: 0;
	color: white;
	font-size: 24px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 12px;
}

.stw-plugin-title h1::before {
	content: "";
	display: inline-block;
	width: 32px;
	height: 32px;
	border-radius: 6px;
	background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNyAyMCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJTVFcgaWNvbiI+PHBhdGggZmlsbD0iIzEwYjk4MSIgZD0iTTcuMSAxNi44NmMtLjI2LS4wMy0uNjEtLjEtLjc4LS4xNmwtLjMyLS4xdi0xLjU3YzAtMS40Ni4wMS0xLjU2LjE1LTEuNTEuMjUuMS44NC4xNSAxLjA4LjA5LjMzLS4wOC42My0uNDUuNjMtLjc3IDAtLjE3LS4xOS0uNjgtLjQ2LTEuMjQtLjU1LTEuMTMtLjcyLTEuNzUtLjcyLTIuNTcgMC0xLjY0IDEuMDEtMy4wOSAyLjU3LTMuNjcuNTgtLjIyIDEuNTctLjI1IDIuMTctLjA3bC4zOC4xMS4wMiAxLjU5Yy4wMiAxLjU1LjAyIDEuNTktLjE0IDEuNS0uNTYtLjMtMS4yNi4xLTEuMzQuNzYtLjA0LjM0LjAxLjQ4LjQyIDEuMjcuNzMgMS40LjkgMi4xMS43NCAzLjEtLjEzLjgzLS41MSAxLjUzLTEuMTUgMi4xNS0uOS44Ny0xLjk5IDEuMjMtMy4yNiAxLjF6Ii8+PC9zdmc+");
	background-size: 32px;
	background-position: center;
	background-repeat: no-repeat;
}

.stw-nav-tabs {
	display: flex;
	gap: 4px;
	margin: -12px -20px 24px;
	padding: 0 32px;
	background: white;
	border-bottom: 1px solid var(--stw-border);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.stw-nav-tab {
	padding: 14px 20px;
	color: var(--stw-gray);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	border-bottom: 2px solid transparent;
	transition: all 0.2s ease;
	position: relative;
}

.stw-nav-tab:hover {
	color: var(--stw-primary);
	background: rgba(16, 185, 129, 0.05);
}

.stw-nav-tab.active {
	color: var(--stw-primary);
	border-bottom-color: var(--stw-primary);
	font-weight: 600;
}

.stw-route-content {
	animation: fadeIn 0.3s ease;
	padding: 0 12px;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.stw-route-content .wrap {
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	border: none !important;
}

.stw-route-content h1 {
	color: var(--stw-dark);
	font-size: 26px;
	font-weight: 700;
	margin: 0 0 24px;
}

.stw-route-content h2 {
	color: var(--stw-dark);
	font-size: 20px;
	font-weight: 600;
	margin: 24px 0 16px;
}

/* ==========================================================================
   SHARED RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 992px) {
	.stw-admin-content {
		padding: 0 10px;
	}
}

@media (max-width: 782px) {
	.stw-items-grid {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	}

	.modal-content {
		margin: 20px;
		padding: 20px;
		width: calc(100% - 40px);
	}
}

@media (max-width: 480px) {
	.stw-items-grid {
		grid-template-columns: 1fr;
	}
}
