/* Compact Kaspa Payment Checkout - Fits in viewport */

/* NEW: Compact layout styles */
.kaspa-payment-header-compact {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.kaspa-payment-header-compact h2 {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

.kaspa-price-compact {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
}

.kaspa-payment-methods-compact {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.kaspa-payment-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.kaspa-qr-compact {
    flex-shrink: 0;
    text-align: center;
}

.kaspa-qr-compact .kaspa-qr-image {
    width: 160px !important;
    height: 160px !important;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(73, 168, 212, 0.3);
}

.kaspa-qr-note {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #666;
}

.kaspa-qr-note.generating {
    color: #ff9800;
}

.kaspa-payment-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.kaspa-info-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kaspa-copy-field-compact {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.kaspa-copy-field-compact:hover {
    border-color: #70D0F0;
    background: #f0f9fc;
}

.kaspa-copy-text-compact {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 11px;
    word-break: break-all;
    color: #495057;
    flex: 1;
    line-height: 1.4;
}

.kaspa-copy-button-compact {
    background: linear-gradient(135deg, #49a8d4 0%, #2c8fc1 100%);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
}

.kaspa-payment-status-compact {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.kaspa-check-button-compact {
    background: linear-gradient(135deg, #49a8d4 0%, #2c8fc1 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.kaspa-instructions-compact {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    line-height: 1.6;
}

.kaspa-instructions-compact p {
    margin: 0 0 8px 0;
}

.kaspa-critical-notice-compact {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px;
    border-radius: 4px;
    margin-top: 12px;
    font-size: 13px;
}

@media (max-width: 640px) {
    .kaspa-payment-row {
        flex-direction: column;
        align-items: center;
    }

    .kaspa-payment-info {
        width: 100%;
    }
}

/* Compact Kaspa Payment Checkout - Fits in viewport */

/* Base Container */
.kaspa-payment-container {
    max-width: 600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 16px;
    box-sizing: border-box;
}

/* Compact Header */
.kaspa-payment-header {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.kaspa-payment-header h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 700;
    color: #1d2327;
}

.kaspa-amount-highlight {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    box-shadow: 0 4px 16px rgba(79, 172, 254, 0.2);
}

/* Compact Price Widget */
.kaspa-price-widget {
    background: linear-gradient(135deg, #49a8d4 0%, #70D0F0 100%);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    color: white;
    box-shadow: 0 8px 24px rgba(73, 168, 212, 0.3);
}

.kaspa-price-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kaspa-price-value {
    font-size: 20px;
    font-weight: 700;
}

.kaspa-price-meta {
    font-size: 11px;
    opacity: 0.8;
    text-align: right;
}

/* Compact Payment Methods - Single Column */
.kaspa-payment-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

/* Compact Sections */
.kaspa-qr-section,
.kaspa-payment-address-section,
.kaspa-payment-amount-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.kaspa-qr-section h4,
.kaspa-payment-address-section h4,
.kaspa-payment-amount-section h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Compact QR Code */
.kaspa-qr-container {
    text-align: center;
}

.kaspa-qr-image {
    width: 300px !important;
    /* Changed from 120px */
    height: 300px !important;
    /* Changed from 120px */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(73, 168, 212, 0.3);
}

.kaspa-qr-container p {
    margin: 8px 0 0 0 !important;
    color: #666;
    font-size: 12px;
}

/* Compact Copy Fields */
.kaspa-copy-field {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: auto;
}

.kaspa-copy-field:hover {
    border-color: #70D0F0;
    background: #f0f9fc;
    transform: translateY(-1px);
}

.kaspa-copy-text {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 11px;
    word-break: break-all;
    color: #495057;
    flex: 1;
    margin-right: 12px;
    line-height: 1.3;
}

.kaspa-copy-button {
    background: linear-gradient(135deg, #49a8d4 0%, #2c8fc1 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

/* Amount Section Styling */
.kaspa-payment-amount-section {
    background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
}

.kaspa-payment-amount-section h4 {
    color: #00695c;
}

.kaspa-payment-amount-section .kaspa-copy-text {
    font-size: 14px;
    font-weight: 600;
    color: #00695c;
}

.kaspa-payment-amount-section p {
    margin: 8px 0 0 0 !important;
    color: #00695c;
    font-size: 11px;
    font-weight: 500;
}

/* Compact Status */
.kaspa-payment-status-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.kaspa-payment-status {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
}

.kaspa-payment-status.checking {
    background: linear-gradient(135deg, #70D0F0 0%, #49a8d4 100%);
    color: white;
}

.kaspa-payment-status.success {
    background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
    color: white;
}

.kaspa-payment-status.error {
    background: linear-gradient(135deg, #ef5350 0%, #d32f2f 100%);
    color: white;
}

.kaspa-check-button {
    background: linear-gradient(135deg, #49a8d4 0%, #2c8fc1 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.kaspa-check-button:hover {
    transform: translateY(-1px);
}

/* Compact Instructions */
.kaspa-instructions {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.kaspa-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.kaspa-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: rgba(73, 168, 212, 0.05);
    border-radius: 8px;
    font-size: 13px;
}

.kaspa-step-number {
    background: linear-gradient(135deg, #49a8d4 0%, #2c8fc1 100%);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    flex-shrink: 0;
}

.kaspa-critical-notice {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .kaspa-payment-container {
        padding: 12px;
    }

    .kaspa-payment-header {
        padding: 16px;
    }

    .kaspa-payment-header h3 {
        font-size: 20px;
    }

    .kaspa-amount-highlight {
        font-size: 16px;
        padding: 10px 16px;
    }

    .kaspa-qr-image {
        width: 100px !important;
        height: 100px !important;
    }

    .kaspa-copy-text {
        font-size: 10px;
    }
}

/* KasWare Wallet Button */
.kaspa-kasware-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: none; /* Hidden by default, shown by JS when KasWare detected */
}

.kaspa-kasware-section.detected {
    display: block;
}

.kaspa-kasware-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #49a8d4;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kaspa-kasware-badge .kasware-dot {
    width: 8px;
    height: 8px;
    background: #43a047;
    border-radius: 50%;
    display: inline-block;
}

.kaspa-kasware-btn {
    background: linear-gradient(135deg, #49a8d4 0%, #2c8fc1 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    max-width: 320px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
}

.kaspa-kasware-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(73, 168, 212, 0.4);
}

.kaspa-kasware-btn:active {
    transform: translateY(0);
}

.kaspa-kasware-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.kaspa-kasware-btn.connecting {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.kaspa-kasware-btn.success {
    background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
}

.kaspa-kasware-btn.error {
    background: linear-gradient(135deg, #ef5350 0%, #d32f2f 100%);
}

.kaspa-kasware-status {
    font-size: 13px;
    color: #666;
    margin-top: 10px;
    min-height: 20px;
}

.kaspa-kasware-status.verifying {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #43a047;
    font-weight: 500;
}

.kaspa-kasware-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(67, 160, 71, 0.3);
    border-top-color: #43a047;
    border-radius: 50%;
    animation: kasware-spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.kaspa-kasware-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: #999;
    font-size: 13px;
    font-weight: 500;
}

.kaspa-kasware-divider::before,
.kaspa-kasware-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

/* Ensure the page doesn't exceed viewport */
@media (max-height: 800px) {
    .kaspa-payment-container {
        padding: 8px;
    }

    .kaspa-payment-header {
        padding: 12px;
        margin-bottom: 8px;
    }

    .kaspa-qr-section,
    .kaspa-payment-address-section,
    .kaspa-payment-amount-section,
    .kaspa-payment-status-container,
    .kaspa-instructions {
        padding: 12px;
    }

    .kaspa-payment-methods {
        gap: 8px;
        margin-bottom: 8px;
    }

    .kaspa-qr-image {
        width: 100px !important;
        height: 100px !important;
    }
}