/**
 * Six Step HUB3 Payments - Frontend styles
 * Version: 0.2.1
 *
 * Pravilo: BEM imenovanje usklađeno s frontend.js
 *   .sixstep-hub3-modal             - overlay
 *   .sixstep-hub3-modal__dialog     - bijela kartica
 *   .sixstep-hub3-modal__close      - X gumb (apsolutno pozicioniran, gore desno)
 *   .sixstep-hub3-modal__content    - kontejner sadržaja
 *   .sixstep-hub3-modal__title      - naslov modala (h2)
 *   .sixstep-hub3-barcode           - kontejner barkoda
 *   .sixstep-hub3-barcode__wrapper  - omotač canvasa
 *   .sixstep-hub3-barcode__hint     - tekstualna naznaka ispod barkoda
 *   .sixstep-hub3-barcode__error    - poruka greške
 *   .sixstep-hub3-fields            - tablica polja
 *   .sixstep-hub3-payload           - tehnički zapis (pre)
 *   .sixstep-hub3-copy              - copy gumb
 */

/* -----------------------------------------------------------
 * Gumb (frontend shortcode)
 * --------------------------------------------------------- */
.sixstep-hub3-wrapper {
	display: inline-block;
	margin: 8px 0;
}

.sixstep-hub3-button {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 14px 28px;
	min-height: 56px;
	background: #2c5aa0;
	color: #fff;
	border: 0;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.18s ease, transform 0.05s ease;
}

.sixstep-hub3-button:hover,
.sixstep-hub3-button:focus {
	background: #1f4070;
	color: #fff;
	outline: none;
}

.sixstep-hub3-button:active {
	transform: translateY(1px);
}

.sixstep-hub3-button:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.sixstep-hub3-button-amount {
	font-size: 13px;
	font-weight: 400;
	opacity: 0.92;
}

/* -----------------------------------------------------------
 * Obavijesti
 * --------------------------------------------------------- */
.sixstep-hub3-notice {
	padding: 10px 14px;
	background: #f6f7f7;
	border-left: 4px solid #72aee6;
	margin: 10px 0;
	font-size: 14px;
}

.sixstep-hub3-notice-error {
	border-left-color: #d63638;
}

/* -----------------------------------------------------------
 * Lista paketa
 * --------------------------------------------------------- */
.sixstep-hub3-packages-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
	margin: 16px 0;
}

.sixstep-hub3-package-item {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 18px;
	text-align: center;
}

.sixstep-hub3-package-name {
	margin: 0 0 6px;
	font-size: 17px;
}

.sixstep-hub3-package-amount {
	font-size: 22px;
	font-weight: 700;
	margin-bottom: 12px;
	color: #2c5aa0;
}

/* -----------------------------------------------------------
 * Modal / popup - overlay
 * --------------------------------------------------------- */
.sixstep-hub3-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	/* Crna pozadina prema specifikaciji */
	background: #000000;
	-webkit-tap-highlight-color: transparent;
}

.sixstep-hub3-modal.is-open {
	display: flex;
}

body.sixstep-hub3-modal-open {
	overflow: hidden;
}

/* -----------------------------------------------------------
 * Modal - kartica
 * --------------------------------------------------------- */
.sixstep-hub3-modal__dialog {
	position: relative;
	background: #fff;
	width: 100%;
	max-width: 640px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	border-radius: 10px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
	padding: 24px;
}

.sixstep-hub3-modal__content {
	/* Padding desno da naslov ne ide pod X */
	padding-right: 48px;
}

/* -----------------------------------------------------------
 * Modal - X gumb (zatvori)
 * --------------------------------------------------------- */
.sixstep-hub3-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
	border-radius: 50%;
	color: #111827;
	font-size: 28px;
	line-height: 1;
	font-weight: 400;
	cursor: pointer;
	padding: 0;
	margin: 0;
	z-index: 2;
	transition: background-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
	box-shadow: none;
	text-decoration: none;
}

.sixstep-hub3-modal__close:hover,
.sixstep-hub3-modal__close:focus {
	background: #111827;
	color: #ffffff;
	outline: none;
	border-color: #111827;
}

.sixstep-hub3-modal__close:active {
	transform: translateY(1px);
}

/* -----------------------------------------------------------
 * Modal - sadržaj
 * --------------------------------------------------------- */
.sixstep-hub3-modal__title {
	margin: 0 0 16px;
	font-size: 20px;
	font-weight: 700;
	color: #111;
	line-height: 1.3;
}

.sixstep-hub3-loading {
	text-align: center;
	padding: 30px;
	color: #555;
}

.sixstep-hub3-error {
	background: #fde8e8;
	color: #9b1c1c;
	padding: 12px 14px;
	border-radius: 6px;
	margin-bottom: 14px;
	font-size: 14px;
}

/* -----------------------------------------------------------
 * Tablica polja
 * --------------------------------------------------------- */
.sixstep-hub3-fields {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 16px;
}

.sixstep-hub3-fields th,
.sixstep-hub3-fields td {
	padding: 8px 10px;
	border-bottom: 1px solid #eee;
	text-align: left;
	font-size: 14px;
	vertical-align: top;
	color: #111;
}

.sixstep-hub3-fields th {
	width: 38%;
	color: #555;
	font-weight: 600;
}

/* -----------------------------------------------------------
 * Barkod
 * --------------------------------------------------------- */
.sixstep-hub3-barcode {
	text-align: center;
	margin: 0 0 18px;
}

.sixstep-hub3-barcode h3 {
	margin: 0 0 10px;
	font-size: 15px;
	font-weight: 600;
	color: #111;
}

.sixstep-hub3-barcode__wrapper {
	display: inline-block;
	padding: 14px;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
}

.sixstep-hub3-barcode__wrapper canvas,
.sixstep-hub3-barcode__wrapper svg {
	max-width: 100%;
	height: auto;
	display: block;
	background: #fff;
}

.sixstep-hub3-barcode__hint {
	font-size: 12px;
	color: #666;
	margin: 8px 0 0;
}

.sixstep-hub3-barcode__error {
	background: #fde8e8;
	color: #9b1c1c;
	padding: 10px 12px;
	border-radius: 6px;
	margin: 10px 0 0;
	font-size: 13px;
}

/* -----------------------------------------------------------
 * Tehnički HUB3 zapis (details)
 * --------------------------------------------------------- */
.sixstep-hub3-technical {
	background: #f6f7f9;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	padding: 10px 12px;
	margin: 0 0 16px;
	font-size: 13px;
	color: #111;
}

.sixstep-hub3-technical summary {
	cursor: pointer;
	font-weight: 600;
	user-select: none;
}

.sixstep-hub3-payload {
	font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	font-size: 12px;
	white-space: pre;
	overflow-x: auto;
	margin: 10px 0 0;
	padding: 10px;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 4px;
	color: #111;
}

/* -----------------------------------------------------------
 * Akcije (copy gumb)
 * --------------------------------------------------------- */
.sixstep-hub3-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
	margin: 0;
}

.sixstep-hub3-copy {
	background: #2c5aa0;
	color: #fff;
	border: 0;
	padding: 10px 18px;
	border-radius: 5px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: background-color 0.18s ease;
}

.sixstep-hub3-copy:hover,
.sixstep-hub3-copy:focus {
	background: #1f4070;
	color: #fff;
	outline: none;
}

.sixstep-hub3-copy.is-copied {
	background: #15803d;
}

/* -----------------------------------------------------------
 * Member code shortcode
 * --------------------------------------------------------- */
.sixstep-hub3-member-code {
	font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	font-weight: 600;
	background: #f0f4ff;
	padding: 2px 8px;
	border-radius: 3px;
}

/* -----------------------------------------------------------
 * Responsive
 * --------------------------------------------------------- */
@media (max-width: 480px) {
	.sixstep-hub3-modal {
		padding: 0;
	}

	.sixstep-hub3-modal__dialog {
		max-height: 100vh;
		max-width: 100%;
		border-radius: 0;
		padding: 20px 16px;
	}

	.sixstep-hub3-modal__content {
		padding-right: 0;
		padding-top: 40px;
	}

	.sixstep-hub3-modal__close {
		top: 8px;
		right: 8px;
	}

	.sixstep-hub3-fields th,
	.sixstep-hub3-fields td {
		display: block;
		width: 100%;
		padding: 4px 0;
		border-bottom: 0;
	}

	.sixstep-hub3-fields tr {
		border-bottom: 1px solid #eee;
		padding: 8px 0;
		display: block;
	}

	.sixstep-hub3-actions {
		justify-content: stretch;
	}

	.sixstep-hub3-copy {
		flex: 1 1 100%;
	}
}
