/**
 * Krisharth Order Documents Suite
 * Frontend Styles
 *
 * @package KrisharthOrderDocumentsSuite
 */

/*--------------------------------------------------------------
# Order Documents Container
--------------------------------------------------------------*/

.kods-documents {
	margin: 20px 0;
}

.kods-documents h2,
.kods-documents h3 {
	margin: 0 0 20px;
}

/*--------------------------------------------------------------
# Documents Table
--------------------------------------------------------------*/

.kods-documents-table {
	width: 100%;
	border-collapse: collapse;
	margin: 20px 0;
	font-size: 14px;
}

.kods-documents-table th,
.kods-documents-table td {
	padding: 12px;
	border: 1px solid #e2e4e7;
	text-align: left;
	vertical-align: middle;
}

.kods-documents-table th {
	background: #f7f7f7;
	font-weight: 600;
}

.kods-documents-table tbody tr:nth-child(even) {
	background: #fafafa;
}

/*--------------------------------------------------------------
# Status Badges
--------------------------------------------------------------*/

.kods-status {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
}

.kods-status-generated {
	background: #dff6dd;
	color: #0a5c1d;
}

.kods-status-pending {
	background: #fff4ce;
	color: #7a5b00;
}

.kods-status-missing {
	background: #fde7e9;
	color: #a12622;
}

/*--------------------------------------------------------------
# Action Buttons
--------------------------------------------------------------*/

.kods-document-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.kods-document-actions .button,
.kods-document-actions .button-alt {
	min-width: 110px;
	text-align: center;
	text-decoration: none;
}

/*--------------------------------------------------------------
# Loading State
--------------------------------------------------------------*/

.kods-loading {
	position: relative;
	pointer-events: none;
	opacity: 0.7;
}

.kods-loading::after {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-left: 8px;
	vertical-align: middle;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: kods-spin 0.8s linear infinite;
}

@keyframes kods-spin {
	from {
		transform: rotate(0deg);
	}

	to {
		transform: rotate(360deg);
	}
}

/*--------------------------------------------------------------
# Empty State
--------------------------------------------------------------*/

.kods-empty {
	padding: 20px;
	background: #f9f9f9;
	border: 1px solid #e2e4e7;
	border-radius: 4px;
	text-align: center;
	color: #666;
}

/*--------------------------------------------------------------
# Document Card
--------------------------------------------------------------*/

.kods-document-card {
	padding: 20px;
	margin-bottom: 20px;
	border: 1px solid #e2e4e7;
	border-radius: 6px;
	background: #ffffff;
}

.kods-document-card h3 {
	margin-top: 0;
	margin-bottom: 10px;
}

.kods-document-card p:last-child {
	margin-bottom: 0;
}

/*--------------------------------------------------------------
# Customer Notices
--------------------------------------------------------------*/

.kods-notice {
	padding: 12px 15px;
	margin-bottom: 20px;
	border-radius: 4px;
	font-size: 14px;
}

.kods-notice-success {
	background: #edf7ed;
	color: #1b5e20;
	border: 1px solid #c8e6c9;
}

.kods-notice-error {
	background: #fdecea;
	color: #b71c1c;
	border: 1px solid #f5c6cb;
}

/*--------------------------------------------------------------
# My Account Integration
--------------------------------------------------------------*/

.woocommerce-account .kods-documents {
	margin-top: 25px;
}

.woocommerce-account .kods-document-actions {
	justify-content: flex-start;
}

/*--------------------------------------------------------------
# Responsive
--------------------------------------------------------------*/

@media screen and (max-width: 768px) {

	.kods-documents-table,
	.kods-documents-table thead,
	.kods-documents-table tbody,
	.kods-documents-table tr,
	.kods-documents-table td {
		display: block;
		width: 100%;
	}

	.kods-documents-table thead {
		display: none;
	}

	.kods-documents-table tr {
		margin-bottom: 20px;
		border: 1px solid #e2e4e7;
		border-radius: 6px;
		padding: 10px;
		background: #fff;
	}

	.kods-documents-table td {
		border: none;
		padding: 8px 0;
	}

	.kods-documents-table td::before {
		content: attr(data-label);
		display: block;
		font-weight: 600;
		margin-bottom: 4px;
	}

	.kods-document-actions {
		flex-direction: column;
	}

	.kods-document-actions .button,
	.kods-document-actions .button-alt {
		width: 100%;
	}
}