/* Payment System Styles */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --card-border: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* Amount Input */
.amount-input-wrapper {
    position: relative;
}

.amount-input-wrapper .currency-symbol {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 500;
}

.amount-input-wrapper .form-control {
    padding-left: 35px;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--card-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #475569;
}

/* Payment Details */
.payment-view {
    display: none;
}

.payment-view.active {
    display: block;
}

.payment-status {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
}

.payment-status.awaiting {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.payment-status.partial {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

.payment-status.paid, .payment-status.overpaid {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.payment-status.expired {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* Timer */
.timer-section {
    text-align: center;
    margin-bottom: 20px;
}

.timer {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    color: var(--text-primary);
}

.timer.warning {
    color: var(--warning-color);
}

.timer.danger {
    color: var(--danger-color);
}

.timer-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* QR Code */
.qr-section {
    text-align: center;
    margin: 25px 0;
}

.qr-code {
    background: white;
    padding: 15px;
    border-radius: 12px;
    display: inline-block;
}

.qr-code canvas, .qr-code img {
    display: block;
}

/* Payment Info */
.payment-info {
    margin-top: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--card-border);
}

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

.info-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.info-value {
    text-align: right;
    font-weight: 500;
    word-break: break-all;
    max-width: 60%;
}

.info-value.highlight {
    color: var(--primary-color);
    font-weight: 600;
}

/* Copy Button */
.copy-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-btn {
    background: var(--card-border);
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.8rem;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--primary-color);
    color: white;
}

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

/* Address Box */
.address-box {
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 14px;
    margin-top: 15px;
    word-break: break-all;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.address-text {
    flex: 1;
    color: var(--text-primary);
}

/* Transactions */
.transactions-section {
    margin-top: 25px;
}

.transactions-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.transaction-item {
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
}

.transaction-item.confirmed {
    border-color: var(--success-color);
}

.tx-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tx-amount {
    font-weight: 600;
    color: var(--success-color);
}

.tx-status {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

.tx-status.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

.tx-id {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    word-break: break-all;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading.active {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--card-border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

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

/* Error */
.error-message {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
}

.error-message.active {
    display: block;
}

/* Success Animation */
.success-animation {
    text-align: center;
    padding: 30px 0;
}

.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--success-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: scaleIn 0.3s ease-out;
}

.checkmark svg {
    width: 40px;
    height: 40px;
    color: white;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* Crypto Icons */
.crypto-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    background: var(--primary-color);
    color: white;
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .card {
        padding: 20px;
    }

    .timer {
        font-size: 1.75rem;
    }

    .info-value {
        max-width: 55%;
    }
}

/* Dark scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
