/* ==================== ROOT & VARIABLES ==================== */
:root {
	--primary-color: #6366f1;
	--primary-dark: #4f46e5;
	--primary-light: #818cf8;
	--secondary-color: #8b5cf6;
	--success-color: #10b981;
	--danger-color: #ef4444;
	--warning-color: #f59e0b;
	--text-dark: #1e293b;
	--text-muted: #64748b;
	--bg-light: #f8fafc;
	--border-color: #e2e8f0;
	--shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
	--shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
	--shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
	--shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}

/* ==================== GLOBAL STYLES ==================== */
* {
	box-sizing: border-box;
}

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	min-height: 100vh;
	padding: 20px;
	margin: 0;
}

.swal2-popup {
	padding-top: 1.5rem !important;
	border-radius: 16px !important;
}

/* ==================== MAIN CARD ==================== */
.main-card {
	background: white;
	border-radius: 24px;
	box-shadow: var(--shadow-xl);
	overflow: hidden;
	max-width: 480px;
	margin: 0 auto;
}

/* ==================== HEADER ==================== */
.card-header-modern {
	background: white;
	padding: 24px;
	border-bottom: 1px solid var(--border-color);
}

.header-logo-section {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
}

.header-logo-section img {
	max-width: 140px;
	height: auto;
}

.mitra-name {
	font-weight: 700;
	color: var(--text-dark);
	font-size: 14px;
}

.page-title {
	text-align: center;
	font-size: 28px;
	font-weight: 900;
	color: var(--text-dark);
	margin: 0;
	letter-spacing: -0.5px;
}

/* ==================== VOUCHER CARDS ==================== */
.voucher-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
	padding: 24px;
}

.voucher-card {
	position: relative;
	background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
	border-radius: 20px;
	padding: 24px 16px;
	text-decoration: none;
	color: white;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: var(--shadow-md);
	overflow: hidden;
	text-decoration: none;
}

.voucher-card::before {
	content: '';
	position: absolute;
	top: -50%;
	right: -50%;
	width: 200%;
	height: 200%;
	background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
	transition: transform 0.6s ease;
}

.voucher-card:hover {
	color: white;
	text-decoration: none;
	transform: translateY(-8px) scale(1.02);
	box-shadow: 0 20px 40px rgba(99, 102, 241, 0.4);
}

.voucher-card:hover::before {
	transform: translate(-25%, -25%);
}

.voucher-card:active {
	transform: translateY(-4px) scale(1);
}

.voucher-name {
	font-size: 20px;
	font-weight: 800;
	margin: 0 0 16px 0;
	text-align: center;
	position: relative;
	z-index: 1;
}

.voucher-duration {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(255, 255, 255, 0.25);
	backdrop-filter: blur(10px);
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	margin-bottom: 16px;
	position: relative;
	z-index: 1;
}

.voucher-duration i {
	font-size: 11px;
}

.voucher-price {
	font-size: 18px;
	font-weight: 900;
	text-align: center;
	margin: 0;
	position: relative;
	z-index: 1;
	background: rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(10px);
	padding: 10px;
	border-radius: 12px;
}

/* ==================== PAYMENT PAGE STYLES ==================== */
.detail-paket-card {
	background: white;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: var(--shadow-md);
	margin-bottom: 16px;
}

.detail-paket-header {
	background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
	color: white;
	padding: 16px 24px;
}

.detail-paket-header h4 {
	margin: 0;
	font-weight: 800;
	font-size: 18px;
}

.detail-table {
	width: 100%;
	margin: 0;
}

.detail-table tr {
	border-bottom: 1px solid var(--border-color);
}

.detail-table tr:last-child {
	border-bottom: none;
}

.detail-table td {
	padding: 14px 24px;
	font-weight: 600;
	color: var(--text-dark);
}

.detail-table td:first-child {
	color: var(--text-muted);
	width: 40px;
	text-align: center;
}

.detail-table td:nth-child(2) {
	color: var(--text-muted);
}

/* ==================== TOTAL PAYMENT CARD ==================== */
.total-payment-card {
	background: white;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: var(--shadow-md);
}

.total-payment-body {
	padding: 24px;
	text-align: center;
}

.channel-choose {
	font-size: 14px;
	font-weight: 600;
	color: var(--text-muted);
	margin-bottom: 8px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.total-harga {
	font-size: 36px;
	font-weight: 900;
	color: var(--primary-color);
	margin: 12px 0;
	letter-spacing: -1px;
}

.biaya-admin {
	font-size: 13px;
	color: var(--text-muted);
	font-weight: 600;
	margin-bottom: 4px;
}

.due-date {
	font-size: 12px;
	color: var(--warning-color);
	font-weight: 700;
}

/* ==================== PAYMENT METHOD BUTTONS ==================== */
.payment-methods-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 12px;
	padding: 20px 24px;
}

.btn-payment {
	background: white;
	border: 2px solid var(--border-color);
	border-radius: 16px;
	padding: 16px;
	height: 80px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	cursor: pointer;
	position: relative;
	overflow: hidden;
}

.btn-payment::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.btn-payment img {
	max-width: 90%;
	max-height: 45px;
	position: relative;
	z-index: 1;
	transition: all 0.3s ease;
}

.btn-payment:hover {
	border-color: var(--primary-color);
	transform: translateY(-4px);
	box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.btn-payment.active {
	border-color: var(--primary-color);
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
	box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* ==================== ACTION BUTTONS ==================== */
.action-buttons {
	padding: 0 24px 24px;
}

.btn-modern {
	width: 100%;
	padding: 14px 24px;
	border: none;
	border-radius: 12px;
	font-weight: 700;
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: var(--shadow-sm);
}

.btn-primary-modern {
	background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
	color: white;
}

.btn-primary-modern:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 24px rgba(99, 102, 241, 0.4);
}

.btn-success-modern {
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
	color: white;
}

.btn-success-modern:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 24px rgba(16, 185, 129, 0.4);
}

.btn-danger-modern {
	background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
	color: white;
}

.btn-danger-modern:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 24px rgba(239, 68, 68, 0.4);
}

.btn-back-modern {
	background: white;
	border: 2px solid var(--border-color);
	color: var(--text-dark);
}

.btn-back-modern:hover {
	border-color: var(--text-dark);
	background: var(--bg-light);
}

.button-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 12px;
}

/* ==================== FOOTER ==================== */
.card-footer-modern {
	background: var(--bg-light);
	padding: 16px;
	text-align: center;
	border-top: 1px solid var(--border-color);
}

.powered-by {
	color: var(--text-muted);
	font-size: 12px;
	font-weight: 600;
}

/* ==================== ALERT STYLES ==================== */
.alert-modern {
	background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
	border-left: 4px solid var(--danger-color);
	padding: 16px 20px;
	border-radius: 12px;
	color: #991b1b;
	font-weight: 600;
}

/* ==================== VOUCHER HISTORY ==================== */
.history-toggle {
	cursor: pointer;
	user-select: none;
}

.history-toggle h4 {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.history-item {
	padding: 14px 24px;
	border-bottom: 1px solid var(--border-color);
}

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

.history-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 4px;
}

.history-date {
	font-size: 12px;
	color: var(--text-muted);
	font-weight: 600;
}

.history-badge {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	padding: 3px 10px;
	border-radius: 20px;
	color: white;
}

.badge-history-success { background: var(--success-color); }
.badge-history-warning { background: var(--warning-color); }
.badge-history-danger { background: var(--danger-color); }
.badge-history-cancelled { background: var(--text-muted); }

.history-mid {
	font-size: 14px;
	font-weight: 700;
	color: var(--text-dark);
	margin-bottom: 8px;
}

.history-code {
	font-size: 13px;
	color: var(--text-dark);
	background: var(--bg-light);
	border-radius: 8px;
	padding: 8px 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.btn-copy-history {
	border: none;
	background: var(--primary-color);
	color: white;
	border-radius: 6px;
	padding: 4px 8px;
	cursor: pointer;
}

.history-action-group {
	display: flex;
	flex-direction: row;
	gap: 8px;
}

.history-action-group > * {
	flex: 1;
	min-width: 0;
}

.btn-claim-history,
.btn-pay-history {
	display: block;
	width: 100%;
	box-sizing: border-box;
	border: none;
	border-radius: 10px;
	padding: 10px 8px;
	font-weight: 700;
	font-size: 13px;
	text-align: center;
	text-decoration: none;
	color: white !important;
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.btn-claim-history {
	background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.btn-pay-history {
	background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
	text-align: center;
	padding: 48px 24px;
	color: var(--text-muted);
}

.empty-state i {
	font-size: 48px;
	opacity: 0.3;
	margin-bottom: 16px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 576px) {
	body {
		padding: 12px;
	}

	.main-card {
		border-radius: 20px;
	}

	.page-title {
		font-size: 24px;
	}

	.voucher-grid {
		padding: 16px;
		gap: 12px;
	}

	.voucher-card {
		padding: 20px 12px;
	}

	.voucher-name {
		font-size: 18px;
	}

	.voucher-price {
		font-size: 16px;
	}

	.total-harga {
		font-size: 32px;
	}

	.header-logo-section img {
		max-width: 120px;
	}

	.mitra-name {
		font-size: 12px;
	}

	.history-action-group {
		gap: 6px;
	}

	.btn-claim-history,
	.btn-pay-history {
		font-size: 11px;
		padding: 10px 4px;
	}

	/* Consistent mobile padding */
	.detail-table td {
		padding: 12px 16px;
	}
	
	.payment-methods-grid,
	.action-buttons,
	.total-payment-body,
	.detail-paket-header {
		padding-left: 16px !important;
		padding-right: 16px !important;
	}
}

@media (min-width: 992px) {
	.main-card {
		max-width: 780px;
	}

	.voucher-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* ==================== UTILITIES ==================== */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.text-center { text-align: center; }
.d-none { display: none; }
.d-block { display: block; }

/* ==================== CARI PESANAN (kode GV...) ==================== */
.history-lookup {
	padding: 12px 16px 16px;
	border-top: 1px dashed #E2E8F0;
}

.history-lookup-label {
	font-size: 12px;
	color: var(--text-muted);
	margin-bottom: 8px;
}

.history-lookup-row {
	display: flex;
	gap: 8px;
}

.history-lookup-row input {
	flex: 1;
	min-width: 0;
	border: 1px solid #CBD5E1;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	font-family: monospace;
}

.history-lookup-row .btn-claim-history {
	width: auto;
	flex: 0 0 auto;
	padding: 10px 18px;
}

.order-code-info {
	margin-top: 10px;
	padding: 8px 10px;
	font-size: 13px;
	background: #F1F5FF;
	border: 1px solid #D6E0FF;
	border-radius: 8px;
}

.order-code-info span {
	font-size: 11px;
	color: var(--text-muted);
}
