/**
 * Dolifast - Quick Lines Module
 * CSS Styles
 * Según doc de Dolibarr: Module development - Define your CSS styles
 * 
 * @file css/dolifast.css
 * @ingroup dolifast
 */

/* Button container */
.dolifast-button-container {
	margin: 10px 0;
}

/* Modal overlay */
.dolifast-modal {
	display: none;
	position: fixed;
	z-index: 9999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgba(0, 0, 0, 0.5);
}

/* Price level selection modal */
.dolifast-price-modal {
	display: block;
	position: fixed;
	z-index: 10000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgba(0, 0, 0, 0.6);
}

.dolifast-price-modal-content {
	background-color: #fefefe;
	margin: 10% auto;
	padding: 20px;
	border: 1px solid #888;
	width: 90%;
	max-width: 500px;
	border-radius: 4px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.dolifast-price-modal-content h3 {
	margin-top: 0;
	color: #333;
	border-bottom: 2px solid #4CAF50;
	padding-bottom: 10px;
}

.dolifast-price-levels {
	margin: 20px 0;
}

.dolifast-price-level {
	display: flex;
	align-items: center;
	padding: 15px;
	margin: 10px 0;
	border: 2px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s ease;
	background-color: #fff;
}

.dolifast-price-level:hover,
.dolifast-price-level:focus {
	border-color: #4CAF50;
	background-color: #f0f9f0;
	outline: none;
	box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.dolifast-price-level-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	background-color: #4CAF50;
	color: white;
	border-radius: 50%;
	font-weight: bold;
	font-size: 18px;
	margin-right: 15px;
}

.dolifast-price-level-label {
	flex: 1;
	font-weight: 500;
	color: #333;
}

.dolifast-price-level-price {
	font-weight: bold;
	font-size: 18px;
	color: #4CAF50;
}

/* Modal content */
.dolifast-modal-content {
	background-color: #fefefe;
	margin: 2% auto;
	padding: 0;
	border: 1px solid #888;
	width: 95%;
	max-width: 1400px;
	border-radius: 4px;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Modal header */
.dolifast-modal-header {
	padding: 15px 20px;
	background-color: #f5f5f5;
	border-bottom: 1px solid #ddd;
	border-radius: 4px 4px 0 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.dolifast-modal-header h3 {
	margin: 0;
	font-size: 18px;
	color: #333;
}

/* Close button */
.dolifast-close {
	color: #aaa;
	font-size: 28px;
	font-weight: bold;
	cursor: pointer;
	line-height: 20px;
}

.dolifast-close:hover,
.dolifast-close:focus {
	color: #000;
}

/* Modal body */
.dolifast-modal-body {
	padding: 20px;
	max-height: calc(100vh - 250px);
	overflow-y: auto;
}

/* Search section */
.dolifast-search-section {
	margin-bottom: 20px;
}

.dolifast-search-section label {
	display: block;
	margin-bottom: 8px;
	font-weight: bold;
	color: #333;
}

.dolifast-search-container {
	position: relative;
	max-width: 500px;
}

#dolifast-search-input {
	width: 100%;
	padding: 8px 12px;
	font-size: 14px;
	border: 1px solid #ccc;
	border-radius: 4px;
}

/* Search results dropdown */
.dolifast-search-results {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: white;
	border: 1px solid #ccc;
	border-top: none;
	border-radius: 0 0 4px 4px;
	max-height: 300px;
	overflow-y: auto;
	z-index: 1000;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dolifast-results-list {
	padding: 0;
	margin: 0;
}

.dolifast-result-item {
	padding: 10px 12px;
	cursor: pointer;
	border-bottom: 1px solid #eee;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: background-color 0.2s;
}

.dolifast-result-item:hover {
	background-color: #f0f0f0;
}

.dolifast-result-item:last-child {
	border-bottom: none;
}

.dolifast-result-ref {
	font-weight: bold;
	color: #333;
	margin-right: 10px;
}

.dolifast-result-label {
	flex: 1;
	color: #666;
}

.dolifast-result-price {
	font-weight: bold;
	color: #007bff;
	margin-left: 10px;
}

.dolifast-loading,
.dolifast-error,
.dolifast-no-results {
	padding: 10px 12px;
	text-align: center;
	color: #666;
}

.dolifast-error {
	color: #d9534f;
}

/* Lines section */
.dolifast-lines-section {
	margin-bottom: 20px;
}

.dolifast-lines-table {
	width: 100%;
	border-collapse: collapse;
	background: white;
}

.dolifast-lines-table thead {
	background-color: #f5f5f5;
	border-bottom: 2px solid #ddd;
}

.dolifast-lines-table th {
	padding: 10px 8px;
	text-align: left;
	font-weight: bold;
	color: #333;
	font-size: 13px;
}

.dolifast-lines-table td {
	padding: 8px;
	border-bottom: 1px solid #eee;
	vertical-align: top;
}

.dolifast-lines-table tbody tr:hover {
	background-color: #f9f9f9;
}

.dolifast-line-input {
	width: 100%;
	padding: 6px 8px;
	border: 1px solid #ccc;
	border-radius: 3px;
	font-size: 13px;
}

.dolifast-line-input:focus {
	outline: none;
	border-color: #007bff;
}

/* Hide number input spinners (arrows) */
.dolifast-line-input[type="number"]::-webkit-outer-spin-button,
.dolifast-line-input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.dolifast-line-input[type="number"] {
	-moz-appearance: textfield;
	appearance: textfield;
}

/* VAT select dropdown */
.dolifast-vat-select {
	min-width: 120px;
	padding: 6px 8px;
	background-color: #fff;
	cursor: pointer;
}

.dolifast-vat-select:hover {
	border-color: #007bff;
}

.dolifast-subtotal {
	font-weight: bold;
	color: #333;
	text-align: right;
}

.dolifast-delete-line {
	background: none;
	border: none;
	color: #d9534f;
	cursor: pointer;
	padding: 5px 10px;
	font-size: 16px;
	transition: color 0.2s;
}

.dolifast-delete-line:hover {
	color: #c9302c;
}

.dolifast-empty-message td {
	font-style: italic;
}

/* Summary section */
.dolifast-summary {
	display: flex;
	justify-content: flex-end;
	gap: 30px;
	padding: 15px;
	background-color: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.dolifast-summary-item {
	display: flex;
	gap: 10px;
	align-items: center;
	font-size: 14px;
}

.dolifast-summary-item strong {
	color: #333;
}

.dolifast-summary-item span {
	color: #007bff;
	font-weight: bold;
	font-size: 16px;
}

/* Modal footer */
.dolifast-modal-footer {
	padding: 15px 20px;
	background-color: #f5f5f5;
	border-top: 1px solid #ddd;
	border-radius: 0 0 4px 4px;
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

.dolifast-modal-footer .button {
	padding: 8px 16px;
	font-size: 14px;
	border-radius: 4px;
	cursor: pointer;
	border: 1px solid #ccc;
	transition: all 0.2s;
}

.dolifast-modal-footer .button-cancel {
	background-color: #fff;
	color: #333;
}

.dolifast-modal-footer .button-cancel:hover {
	background-color: #f5f5f5;
}

.dolifast-modal-footer .button-save {
	background-color: #5cb85c;
	color: white;
	border-color: #4cae4c;
}

.dolifast-modal-footer .button-save:hover {
	background-color: #449d44;
}

.dolifast-modal-footer .button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
	.dolifast-modal-content {
		width: 98%;
	}
	
	.dolifast-lines-table {
		font-size: 12px;
	}
	
	.dolifast-lines-table th,
	.dolifast-lines-table td {
		padding: 6px 4px;
	}
}

@media (max-width: 768px) {
	.dolifast-modal-content {
		margin: 5% auto;
		width: 100%;
	}
	
	.dolifast-modal-body {
		padding: 10px;
	}
	
	.dolifast-lines-table {
		display: block;
		overflow-x: auto;
	}
	
	.dolifast-summary {
		flex-direction: column;
		gap: 10px;
	}
}
