* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --card-bg: rgba(18, 18, 26, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-color: #f0f0f5;
    --text-muted: rgba(255, 255, 255, 0.5);
    --accent-primary: #00f0ff;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #00f0ff 0%, #8b5cf6 100%);
    --warning-color: #ff4757;
    --warning-glow: rgba(255, 71, 87, 0.3);
    --success-color: #2ed573;
    --wa-color: #25D366;
    --glass-blur: 20px;
    --glow-spread: 80px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 240, 255, 0.2),
                    0 0 40px rgba(0, 240, 255, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 240, 255, 0.4),
                    0 0 60px rgba(0, 240, 255, 0.2);
    }
}

@keyframes scan-line {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(0, 240, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 71, 87, 0.05) 0%, transparent 70%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    z-index: -2;
}

/* Grid Pattern Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
}

.container {
    max-width: 480px;
    width: 100%;
    position: relative;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 36px 28px;
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow:
        0 0 var(--glow-spread) rgba(0, 240, 255, 0.08),
        0 25px 80px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

/* Scan line effect */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0.5;
    animation: scan-line 4s linear infinite;
}

.hidden {
    display: none !important;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-muted);
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 28px;
}

.icon-warning {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px var(--warning-glow));
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Info Boxes */
.info-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 22px;
    margin-bottom: 18px;
    transition: all 0.3s ease;
}

.info-box:hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.info-box h3 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box h3::before {
    content: '';
    width: 3px;
    height: 12px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

/* Customer Info */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-row .label {
    color: var(--text-muted);
    font-size: 13px;
}

.info-row .value {
    font-weight: 600;
    font-size: 14px;
}

/* Reason Box */
.reason-box {
    border-color: rgba(255, 71, 87, 0.3);
    background: rgba(255, 71, 87, 0.05);
    box-shadow: inset 0 0 30px rgba(255, 71, 87, 0.05);
}

.reason-box h3 {
    color: var(--warning-color);
}

.reason-box h3::before {
    background: var(--warning-color);
}

.reason-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 14px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.reason-item:last-child {
    margin-bottom: 0;
}

.reason-item:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateX(4px);
}

.reason-icon {
    font-size: 24px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.reason-text {
    flex: 1;
}

.reason-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text-color);
}

.reason-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Invoice Box */
.invoice-number {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.5px;
}

.invoice-items {
    margin-bottom: 18px;
}

.invoice-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
}

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

.invoice-item .desc {
    flex: 1;
    padding-right: 20px;
    color: var(--text-muted);
}

.invoice-item .price {
    font-weight: 600;
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
}

.invoice-total {
    display: flex;
    justify-content: space-between;
    padding: 18px 0 0;
    border-top: 2px solid;
    border-image: var(--accent-gradient) 1;
    font-size: 18px;
    font-weight: 700;
}

.invoice-total .amount {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'JetBrains Mono', monospace;
}

.due-date {
    margin-top: 18px;
    padding: 14px 18px;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.2);
    border-radius: 12px;
    color: var(--warning-color);
    font-size: 14px;
    text-align: center;
    font-weight: 500;
}

.grace-info {
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* Payment Box */
.payment-box {
    border-color: rgba(0, 240, 255, 0.3);
    background: rgba(0, 240, 255, 0.03);
    animation: pulse-glow 3s ease-in-out infinite;
}

.payment-box h3 {
    color: var(--accent-primary);
}

.payment-box h3::before {
    background: var(--accent-primary);
}

.va-info {
    text-align: center;
}

.va-bank {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.va-number {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 4px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 16px;
    margin-bottom: 16px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    color: var(--accent-primary);
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.va-number::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% { left: 100%; }
}

.va-amount {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--text-muted);
}

.va-amount span:last-child {
    font-weight: 700;
    color: var(--text-color);
    font-family: 'JetBrains Mono', monospace;
}

.va-expiry {
    font-size: 12px;
    color: var(--warning-color);
    margin-bottom: 20px;
    padding: 8px 12px;
    background: rgba(255, 71, 87, 0.1);
    border-radius: 8px;
    display: inline-block;
}

.qris-info {
    text-align: center;
}

.qris-image {
    max-width: 200px;
    border-radius: 16px;
    margin-bottom: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.qris-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.no-payment {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-copy {
    width: 100%;
    background: var(--accent-gradient);
    color: #000;
    font-weight: 700;
}

.btn-copy:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(0, 240, 255, 0.4);
}

.btn-copy:active {
    transform: translateY(-1px);
}

.btn-copy.copied {
    background: var(--success-color);
}

.btn-wa {
    background: var(--wa-color);
    color: #fff;
    flex: 1;
}

.btn-wa:hover {
    background: #1fb855;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.3);
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-color);
    flex: 1;
    border: 1px solid var(--border-color);
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.15);
}

.actions {
    display: flex;
    gap: 14px;
    margin-top: 28px;
}

/* Footer */
.footer {
    margin-top: 28px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.footer p:first-child {
    font-weight: 600;
    letter-spacing: 1px;
}

.client-ip {
    margin-top: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    opacity: 0.4;
}

/* Error State */
.error {
    text-align: center;
    padding: 50px 20px;
}

.icon-error {
    font-size: 56px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px var(--warning-glow));
}

.error h2 {
    font-size: 20px;
    margin-bottom: 14px;
    color: var(--warning-color);
}

.error p {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 14px;
}

/* Not Isolated State */
.not-isolated {
    text-align: center;
    padding: 50px 20px;
}

.icon-success {
    font-size: 64px;
    color: var(--success-color);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(46, 213, 115, 0.4));
    animation: float 3s ease-in-out infinite;
}

.not-isolated h2 {
    font-size: 22px;
    color: var(--success-color);
    margin-bottom: 14px;
    font-weight: 700;
}

.not-isolated p {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 14px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .card {
        padding: 28px 20px;
        border-radius: 24px;
    }

    .header h1 {
        font-size: 20px;
    }

    .icon-warning {
        font-size: 52px;
    }

    .va-number {
        font-size: 22px;
        letter-spacing: 2px;
        padding: 16px;
    }

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .info-box {
        padding: 18px;
    }
}

/* Dark mode optimization */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #050508;
    }
}
