/**
 * Coop Orders Sync - Frontend Shortcodes Styles
 *
 * @package CoopOrdersSync
 * @since 1.0.0
 */

/* =========================================
   General Styles
   ========================================= */

.coop-orders-list,
.coop-materials-list,
.coop-operations-list,
.coop-single-order {
	margin: 20px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* =========================================
   Tables
   ========================================= */

.coop-orders-table,
.coop-materials-table,
.coop-operations-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	overflow: hidden;
}

.coop-orders-table thead,
.coop-materials-table thead,
.coop-operations-table thead {
	background: #f7f7f7;
}

.coop-orders-table th,
.coop-materials-table th,
.coop-operations-table th {
	padding: 12px 15px;
	text-align: left;
	font-weight: 600;
	color: #333;
	border-bottom: 2px solid #e5e5e5;
}

.coop-orders-table td,
.coop-materials-table td,
.coop-operations-table td {
	padding: 12px 15px;
	border-bottom: 1px solid #f0f0f0;
	color: #555;
}

.coop-orders-table tbody tr:hover,
.coop-materials-table tbody tr:hover,
.coop-operations-table tbody tr:hover {
	background: #f9f9f9;
}

.coop-orders-table tbody tr:last-child td,
.coop-materials-table tbody tr:last-child td,
.coop-operations-table tbody tr:last-child td {
	border-bottom: none;
}

/* Column Alignments */
.coop-column-date,
.coop-column-quantity,
.coop-column-cost,
.coop-column-duration,
.coop-column-number {
	text-align: right;
}

/* =========================================
   Status Badges
   ========================================= */

.coop-status-badge {
	display: inline-block;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 3px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Order Status Colors */
.coop-status-pending {
	background: #f0ad4e;
	color: #fff;
}

.coop-status-in-progress,
.coop-status-in_progress {
	background: #5bc0de;
	color: #fff;
}

.coop-status-completed,
.coop-status-done {
	background: #5cb85c;
	color: #fff;
}

.coop-status-cancelled,
.coop-status-canceled {
	background: #d9534f;
	color: #fff;
}

.coop-status-on-hold,
.coop-status-on_hold {
	background: #dcdcde;
	color: #333;
}

/* =========================================
   Image Column
   ========================================= */

.coop-column-image {
	width: 80px;
	text-align: center;
}

.coop-column-image img {
	max-width: 60px;
	height: auto;
	border-radius: 4px;
	display: block;
	margin: 0 auto;
}

/* For table column */
.coop-column-image .coop-no-image {
	width: 60px;
	height: 60px;
	background: #f0f0f0;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto;
}

.coop-column-image .coop-no-image::before {
	content: "\1F4E6";
	font-size: 24px;
	opacity: 0.3;
}

/* For single order card */
.coop-order-image .coop-no-image {
	width: 100%;
	aspect-ratio: 4/3;
	background: #f5f5f5;
	border-radius: 8px;
	border: 2px dashed #ddd;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.coop-order-image .coop-no-image svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* =========================================
   Links
   ========================================= */

.coop-orders-table a,
.coop-single-order a {
	color: #0073aa;
	text-decoration: none;
	transition: color 0.2s;
}

.coop-orders-table a:hover,
.coop-single-order a:hover {
	color: #005177;
	text-decoration: underline;
}

/* =========================================
   Empty States
   ========================================= */

.coop-orders-empty,
.coop-materials-empty,
.coop-operations-empty {
	padding: 40px 20px;
	text-align: center;
	background: #f9f9f9;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
}

.coop-orders-empty p,
.coop-materials-empty p,
.coop-operations-empty p {
	margin: 0;
	color: #777;
	font-size: 16px;
}

/* =========================================
   Error Messages
   ========================================= */

.coop-error {
	padding: 15px;
	background: #fee;
	border: 1px solid #fcc;
	border-radius: 4px;
	color: #d00;
	margin: 20px 0;
}

/* =========================================
   Single Order View
   ========================================= */

.coop-single-order {
	background: #fff;
	padding: 30px;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.coop-order-header {
	display: flex;
	gap: 30px;
	margin-bottom: 30px;
	padding-bottom: 20px;
	border-bottom: 2px solid #e5e5e5;
	align-items: flex-start;
}

.coop-order-image {
	flex-shrink: 0;
	max-width: 400px;
	width: 100%;
	border-radius: 8px;
}

/* =========================================
   Images Gallery
   ========================================= */

.coop-images-gallery {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.coop-gallery-main {
	width: 100%;
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	background: #f5f5f5;
	transition: box-shadow 0.3s ease;
	cursor: pointer;
}

.coop-gallery-main:hover {
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.coop-gallery-main img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.coop-gallery-main:hover img {
	transform: scale(1.03);
}

.coop-gallery-thumbnails {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
	gap: 10px;
}

.coop-gallery-thumb {
	position: relative;
	width: 100%;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 4px;
	border: 2px solid #e5e5e5;
	background: #f5f5f5;
	cursor: pointer;
	transition: all 0.3s ease;
}

.coop-gallery-thumb:hover {
	border-color: #0073aa;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.coop-gallery-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.coop-gallery-thumb.active {
	border-color: #0073aa;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
}

.coop-order-info {
	flex: 1;
	min-width: 0;
}

.coop-order-title {
	margin: 0 0 15px 0;
	font-size: 28px;
	font-weight: 600;
	color: #333;
}

.coop-order-content {
	margin-bottom: 30px;
	line-height: 1.6;
	color: #555;
}

.coop-order-content p:first-child {
	margin-top: 0;
}

.coop-order-content p:last-child {
	margin-bottom: 0;
}

/* =========================================
   Order Meta
   ========================================= */

.coop-order-meta {
	margin-bottom: 30px;
	padding: 20px;
	background: #f9f9f9;
	border-radius: 4px;
}

.coop-order-meta h3 {
	margin: 0 0 15px 0;
	font-size: 18px;
	font-weight: 600;
	color: #333;
}

.coop-meta-list {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 10px 20px;
	margin: 0;
}

.coop-meta-list dt {
	font-weight: 600;
	color: #555;
}

.coop-meta-list dd {
	margin: 0;
	color: #333;
}

/* =========================================
   Order Materials & Operations
   ========================================= */

.coop-order-materials,
.coop-order-operations {
	margin-bottom: 30px;
}

.coop-order-materials:last-child,
.coop-order-operations:last-child {
	margin-bottom: 0;
}

.coop-order-materials h3,
.coop-order-operations h3 {
	margin: 0 0 15px 0;
	font-size: 20px;
	font-weight: 600;
	color: #333;
}

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

@media (max-width: 768px) {
	/* Stack header on mobile */
	.coop-order-header {
		flex-direction: column;
		gap: 20px;
	}

	.coop-order-image img {
		max-width: 100%;
	}

	/* Responsive tables */
	.coop-orders-table,
	.coop-materials-table,
	.coop-operations-table {
		font-size: 14px;
	}

	.coop-orders-table th,
	.coop-orders-table td,
	.coop-materials-table th,
	.coop-materials-table td,
	.coop-operations-table th,
	.coop-operations-table td {
		padding: 8px 10px;
	}

	/* Hide image column on mobile */
	.coop-column-image {
		display: none;
	}

	/* Stack meta list on mobile */
	.coop-meta-list {
		grid-template-columns: 1fr;
		gap: 5px;
	}

	.coop-meta-list dt {
		margin-bottom: 2px;
	}

	.coop-meta-list dd {
		margin-bottom: 10px;
		padding-bottom: 10px;
		border-bottom: 1px solid #e5e5e5;
	}

	.coop-meta-list dd:last-child {
		border-bottom: none;
		margin-bottom: 0;
		padding-bottom: 0;
	}

	/* Reduce padding on mobile */
	.coop-single-order {
		padding: 20px 15px;
	}

	.coop-order-title {
		font-size: 24px;
	}

	/* Stack image and info on mobile */
	.coop-order-header {
		flex-direction: column;
		gap: 20px;
	}

	.coop-order-image {
		max-width: 100%;
	}
}

@media (max-width: 480px) {
	/* Make tables scrollable on small screens */
	.coop-orders-list,
	.coop-materials-list,
	.coop-operations-list {
		overflow-x: auto;
	}

	.coop-orders-table,
	.coop-materials-table,
	.coop-operations-table {
		min-width: 500px;
	}
}

/* =========================================
   Print Styles
   ========================================= */

@media print {
	.coop-single-order {
		box-shadow: none;
		border: 1px solid #000;
	}

	.coop-status-badge {
		border: 1px solid #000;
	}

	.coop-orders-table a,
	.coop-single-order a {
		color: #000;
		text-decoration: underline;
	}
}

/* =========================================
   Collection Shortcode
   ========================================= */

.coop-collection {
	margin: 40px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.coop-collection__title {
	margin: 0 0 15px 0;
	font-size: 32px;
	font-weight: 700;
	color: #333;
	line-height: 1.2;
}

.coop-collection__description {
	margin-bottom: 30px;
	line-height: 1.6;
	color: #555;
	font-size: 16px;
}

.coop-collection__description p:first-child {
	margin-top: 0;
}

.coop-collection__description p:last-child {
	margin-bottom: 0;
}

.coop-collection__items {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 30px;
}

.coop-collection__item {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 25px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
}

.coop-collection__item:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
	border-color: #0073aa;
}

.coop-collection__item-content {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.coop-collection__item-title {
	margin: 0 0 12px 0;
	font-size: 20px;
	font-weight: 600;
	color: #333;
	line-height: 1.3;
}

.coop-collection__item-date {
	margin-bottom: 12px;
	font-size: 14px;
	color: #777;
}

.coop-collection__item-date time {
	font-weight: 500;
}

.coop-collection__item-excerpt {
	flex: 1;
	margin-bottom: 15px;
	line-height: 1.5;
	color: #555;
	font-size: 15px;
}

.coop-collection__item-excerpt p:first-child {
	margin-top: 0;
}

.coop-collection__item-excerpt p:last-child {
	margin-bottom: 0;
}

.coop-collection__item-status {
	margin-bottom: 15px;
}

.coop-collection__item-status-label {
	display: inline-block;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 600;
	background: #f0f0f1;
	color: #555;
	border-radius: 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.coop-collection__item-links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: auto;
}

.coop-collection__item-link {
	display: inline-flex;
	align-items: center;
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	border-radius: 5px;
	transition: all 0.2s ease;
}

.coop-collection__item-link--file {
	background: #0073aa;
	color: #fff;
}

.coop-collection__item-link--file:hover {
	background: #005177;
	color: #fff;
	text-decoration: none;
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
}

.coop-collection__item-link--external {
	background: #f0f0f1;
	color: #333;
	border: 1px solid #dcdcde;
}

.coop-collection__item-link--external:hover {
	background: #e5e5e5;
	color: #333;
	text-decoration: none;
	border-color: #999;
}

/* =========================================
   Collection Responsive Design
   ========================================= */

@media (max-width: 768px) {
	.coop-collection__title {
		font-size: 28px;
	}

	.coop-collection__items {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.coop-collection__item {
		padding: 20px;
	}

	.coop-collection__item-title {
		font-size: 18px;
	}
}

@media (max-width: 480px) {
	.coop-collection {
		margin: 30px 0;
	}

	.coop-collection__title {
		font-size: 24px;
	}

	.coop-collection__item {
		padding: 15px;
	}

	.coop-collection__item-links {
		flex-direction: column;
	}

	.coop-collection__item-link {
		width: 100%;
		justify-content: center;
	}
}

/* =========================================
   Collection Print Styles
   ========================================= */

@media print {
	.coop-collection__item {
		box-shadow: none;
		border: 1px solid #000;
		break-inside: avoid;
	}

	.coop-collection__item-link {
		color: #000;
		text-decoration: underline;
		background: none !important;
		border: 1px solid #000;
	}
}

/* =========================================
   Operation Collection Shortcode Styles
   ========================================= */

.coop-operation-collection {
	margin: 40px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Title */
.coop-operation-collection__title {
	font-size: 32px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 20px 0;
	line-height: 1.3;
}

/* Description */
.coop-operation-collection__description {
	font-size: 16px;
	line-height: 1.7;
	color: #555;
	margin-bottom: 30px;
}

.coop-operation-collection__description p {
	margin-bottom: 1em;
}

/* Items Grid */
.coop-operation-collection__items {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 30px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Individual Operation Item */
.coop-operation-collection__item {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 25px;
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
}

.coop-operation-collection__item:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
	border-color: #0073aa;
}

/* Item Content */
.coop-operation-collection__item-content {
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* Item Title */
.coop-operation-collection__item-title {
	font-size: 20px;
	font-weight: 600;
	color: #1a1a1a;
	margin: 0 0 15px 0;
	line-height: 1.4;
}

/* Operation Code */
.coop-operation-collection__item-code {
	font-size: 14px;
	color: #555;
	margin-bottom: 12px;
	padding: 8px 12px;
	background: #f8f9fa;
	border-left: 3px solid #0073aa;
	border-radius: 4px;
}

.coop-operation-collection__item-code strong {
	color: #1a1a1a;
	margin-right: 5px;
}

.coop-operation-collection__item-code code {
	background: #fff;
	padding: 2px 6px;
	border-radius: 3px;
	font-family: Monaco, Consolas, "Courier New", monospace;
	font-size: 13px;
	color: #0073aa;
	border: 1px solid #e5e5e5;
}

/* Excerpt */
.coop-operation-collection__item-excerpt {
	font-size: 15px;
	line-height: 1.6;
	color: #555;
	margin-bottom: 15px;
	flex: 1;
}

.coop-operation-collection__item-excerpt p {
	margin-bottom: 0.8em;
}

.coop-operation-collection__item-excerpt p:last-child {
	margin-bottom: 0;
}

/* Meta Information */
.coop-operation-collection__item-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid #e5e5e5;
}

.coop-operation-collection__item-duration,
.coop-operation-collection__item-price {
	font-size: 14px;
	color: #555;
}

.coop-operation-collection__item-duration strong,
.coop-operation-collection__item-price strong {
	color: #1a1a1a;
	margin-right: 5px;
	font-weight: 600;
}

.coop-operation-collection__item-price span {
	color: #0073aa;
	font-weight: 700;
	font-size: 16px;
}

/* =========================================
   Operation Collection Responsive Design
   ========================================= */

@media (max-width: 1024px) {
	.coop-operation-collection__items {
		grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
		gap: 24px;
	}
}

@media (max-width: 768px) {
	.coop-operation-collection {
		margin: 30px 0;
	}

	.coop-operation-collection__title {
		font-size: 28px;
	}

	.coop-operation-collection__items {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.coop-operation-collection__item {
		padding: 20px;
	}

	.coop-operation-collection__item-title {
		font-size: 18px;
	}

	.coop-operation-collection__item-meta {
		flex-direction: column;
		gap: 10px;
	}
}

@media (max-width: 480px) {
	.coop-operation-collection {
		margin: 20px 0;
	}

	.coop-operation-collection__title {
		font-size: 24px;
	}

	.coop-operation-collection__item {
		padding: 15px;
	}

	.coop-operation-collection__item-code {
		padding: 6px 10px;
		font-size: 13px;
	}
}

/* =========================================
   Operation Collection Print Styles
   ========================================= */

@media print {
	.coop-operation-collection__item {
		box-shadow: none;
		border: 1px solid #000;
		break-inside: avoid;
		page-break-inside: avoid;
	}

	.coop-operation-collection__item-code code {
		border: 1px solid #000;
	}
}
