@import '_settings.scss';
@import '_modals.scss';
@import '_metabox.scss';

table.wc-billingo-plus-payment-table {
	max-width: 1000px;
}

span.wc-billingo-plus-settings-error {
	display: block;
	margin: 0 0 10px 0;
	font-style: normal;
	color: #F56E28;
	padding: 10px 0 0 0;

	&.hidden {
		display: none;
	}
}

span.wc-billingo-plus-settings-error span {
	color: #F56E28;
}

.wc_billingo_pro_label {
	display: none;
}

th .wc_billingo_pro_label,
.wc-settings-sub-title .wc_billingo_pro_label,
.wc-billingo-plus-settings-note-add .wc_billingo_pro_label {
	display: inline-block;
	font-style: normal;
	background: #FF6767;
	border-radius: 3px;
	margin-left: 5px;
	vertical-align: middle;
	color: #fff;
	font-weight: normal;
	font-size: 12px;
	padding: 2px 5px;
	margin-top: -3px;
}

#wc_billingo_plus_block_uid,
#wc_billingo_plus_offer_block,
#wc_billingo_plus_waybill_block,
#wc_billingo_plus_bank_account,
#wc_billingo_plus_receipt_block {

	& ~ span.select2 {
		float: left;
	}

	& ~ p.description {
		clear: both;
	}

	&_reload {
		float: left;
		width: 32px;
		height: 30px;
		margin-left: 5px;
		margin-top: 0;
		margin-bottom: 10px;
		text-decoration: none;
		display: flex;
		align-items: center;
		justify-content: center;
		transition: color ease 0.3s;

		.dashicons {
			font-size: 24px;
			width: 24px;
			height: 24px;
		}

		&.loading {
			span {
				animation: wc_billingo_plus_block_spin 1s linear 0s infinite;
			}
		}

		&:focus {
			box-shadow: none;
		}
 	}
}

@keyframes wc_billingo_plus_block_spin {
	100% {
		transform: rotate(360deg);
	}
}

.notice.wc-billingo-plus-notice {
	position: relative;

	&.wc-billingo-plus-print {
		padding-left: 44px;
	}

	.wc-billingo-plus-wait {
		cursor: wait;
		position: absolute;
		width: 100%;
		height: 100%;
		background-color: rgba(255, 255, 255, 0.5);
		z-index: 1000;
		top: 0;
		left: 0;
	}
}

//Order table buttons
.widefat a.button.wc-billingo-plus-button {
	position: relative;
	width: 2em;
	height: 2em;
	border-color: #FF6767;
	background: #FFF7F4;
	background-repeat: no-repeat;
	background-position: center;
	margin-right: 5px;
  
	&:last-child {
	  margin: 0;
	}
  
	&:focus {
	  box-shadow: 0 0 0 1px #FF6767;
	}
  
	&.wc-billingo-plus-button-invoice {background-image: url(../images/icon-invoice.svg);}
	&.wc-billingo-plus-button-deposit {background-image: url(../images/icon-deposit.svg);}
	&.wc-billingo-plus-button-proform {background-image: url(../images/icon-proform.svg);}
	&.wc-billingo-plus-button-receipt {background-image: url(../images/icon-receipt.svg);}
	&.wc-billingo-plus-button-waybill {background-image: url(../images/icon-waybill.svg);}
	&.wc-billingo-plus-button-offer {background-image: url(../images/icon-offer.svg);}
	&.wc-billingo-plus-button-void {background-image: url(../images/icon-void.svg);}
	&.wc-billingo-plus-button-void_receipt {background-image: url(../images/icon-void_receipt.svg);}
	&.wc-billingo-plus-button-corrected {background-image: url(../images/icon-corrected.svg);}
	&.wc-billingo-plus-button-draft {background-image: url(../images/icon-draft.svg);}
  
}

#wpadminbar ul li#wp-admin-bar-woo-billingo-plus-bg-generate-loading {
	> .ab-empty-item {
		display: block;

		.loading,
		.finished {
			display: flex;
			align-items: center;
		}

		.loading em {
			background: url(../images/icon-sync.svg) no-repeat center;
			width: 24px;
			height: 24px;
			margin-right: 5px;
			background-size: 24px;
			animation: wc_billingo_plus_block_spin 1s linear 0s infinite;
		}

		.finished em {
			background: url(../images/icon-yes.svg) no-repeat center;
			width: 24px;
			height: 24px;
			margin-right: 5px;
			background-size: 24px;
		}

		.finished {
			display: none;
		}
	}

	.admin-color-light & {
		.ab-empty-item .loading em {
			background-image: url(../images/icon-sync-dark.svg);
			opacity: 0.5;
		}

		.ab-empty-item .finished em {
			background-image: url(../images/icon-yes-dark.svg);
			opacity: 0.5;
		}
	}

	&-msg .ab-item.ab-empty-item {
		height: auto;
		line-height: 18px;

		.loading,
		.finished {
			display: block;
		}

		span {
			display: block;
			width: 180px;
			margin: 0 0 0px 0;
			white-space: normal;
			line-height: 18px;
		}

		a {
			text-decoration: underline;
			padding: 0;
		}

		.finished {
			display: none;
		}
	}

	&.finished {
		> .ab-empty-item .loading {
			display: none;
		}

		> .ab-empty-item .finished {
			display: flex;
		}

		#wp-admin-bar-woo-billingo-plus-bg-generate-loading-msg {
			.loading {display: none;}
			.finished {display: block;}
		}
	}

	&.stopped {
		display: none !important;
	}
}

//Email loading indicator
#woocommerce_wc_billingo_plus_section_emails ~ table select.multiselect ~ .blockUI {
	max-width: 400px;
}

.wc-billingo-plus-mark-paid-button {
	width: 30px;
	height: 30px;
	background: url(../images/icon-mark-paid.svg) no-repeat center;
	display: block;
	margin-left: 5px;
	cursor: pointer;
	flex-shrink: 0;
	flex-grow: 0;
	outline: none;
	border-radius: 50%;

	&:focus, &:active {
		outline: none;
	}

	&.paid {
		background: url(../images/icon-paid.svg) no-repeat center;

		&.tips {
			cursor: default;
		}
	}

	&.pending {
		background: url(../images/icon-paid-pending.svg) no-repeat center;
		opacity: 0.1;

		&.tips {
			cursor: default;
		}
	}

	&.tips {
		cursor: pointer;
	}
}

.wc-billingo-plus-mark-paid-item {
	display: flex;
	align-items: center;
	justify-content: flex-end;

	span.tips {
		white-space: nowrap;
	}

	&+span {
		display: none;
	}
}

.wc-billingo-plus-modal-mark-paid {
	display: flex;
	align-items: center;

	label {
		margin-right: 10px;
	}
}

.wc-billingo-plus-start-sync {
	a.button {
		display: flex !important;
		align-items: center;

		span.dashicons {
			margin-right: 5px;
		}

		&.loading span.dashicons {
			animation: wc_billingo_plus_block_spin 1s linear 0s infinite;
		}
	}
}
