/**
 * BSV Payment Console Styles
 * Modern, theme-friendly payment UI for WooCommerce
 */

/* Main payment console container */
.bsv-payment-console {
    width: 100%;
    max-width: 760px;
    margin: 2rem auto;
    padding: 0;
}

/* Payment header */
.bsv-payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    text-align: left;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.bsv-payment-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.bsv-header-left {
    flex: 1;
}

.bsv-payment-header .bsv-instruction {
    margin: 0.35rem 0 0;
    color: #475569;
}

@media (max-width: 640px) {
    .bsv-payment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .bsv-payment-header h2 {
        margin-bottom: 0.25rem;
    }
}

.bsv-payment-steps {
    font-size: 14px;
    opacity: 0.75;
    margin-top: 1rem;
    line-height: 1.6;
}

/* QR Code Card - Always white for scan reliability */
.bsv-qr-card {
    background: #fff;
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
    display: inline-block;
    margin: 0 auto 2rem;
}

.bsv-qr-container {
    text-align: center;
}

.bsv-qr-container svg {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

/* Amount display - Hero element */
.bsv-amount-section {
    text-align: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
}

.bsv-amount {
    font-size: 34px;
    font-weight: 750;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.5rem;
}

.bsv-unit {
    font-size: 16px;
    font-weight: 650;
    opacity: 0.65;
    margin-left: 8px;
}

.bsv-fiat {
    font-size: 14px;
    opacity: 0.6;
    margin-top: 6px;
}

/* Address display */
.bsv-address-section {
    margin: 1.5rem 0;
}

.bsv-address-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.6;
    margin-bottom: 0.5rem;
}

.bsv-address-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.bsv-address {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 13px;
    overflow-wrap: anywhere;
    word-break: break-all;
    flex: 1;
}

/* Copy buttons */
.bsv-copy-btn {
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bsv-copy-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.bsv-copy-btn:active {
    transform: translateY(0);
}

.bsv-copy-btn.copied {
    background: #46b450;
    color: #fff;
    border-color: #46b450;
}

/* Button success state */
.bsv-btn-success {
    background: #46b450 !important;
    color: #fff !important;
    border-color: #46b450 !important;
}

.bsv-btn-success:hover {
    background: #3ea042 !important;
    border-color: #3ea042 !important;
}

/* Status box */
.bsv-status-box {
    margin: 2rem 0;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border-left: 4px solid;
    font-size: 14px;
    line-height: 1.6;
}

.bsv-status-box.status-waiting {
    background: rgba(252, 200, 9, 0.1);
    border-color: #FCCA09;
}

.bsv-status-box.status-detected {
    background: rgba(91, 192, 222, 0.1);
    border-color: #5bc0de;
}

.bsv-status-box.status-confirmed {
    background: rgba(70, 180, 80, 0.1);
    border-color: #46b450;
}

.bsv-status-box.status-expired {
    background: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
}

.bsv-status-box.status-underpaid {
    background: rgba(255, 193, 7, 0.1);
    border-color: #ffc107;
}

.bsv-status-box.status-overpaid {
    background: rgba(23, 162, 184, 0.1);
    border-color: #17a2b8;
}

.bsv-status-label {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 0.25rem;
}

.bsv-status-message {
    opacity: 0.85;
}

/* Expiration countdown */
.bsv-expiration {
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    font-size: 14px;
}

.bsv-expiration-label {
    opacity: 0.6;
    margin-bottom: 0.25rem;
}

.bsv-expiration-time {
    font-weight: 700;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.bsv-expiration-time.warning {
    color: #ffc107;
}

.bsv-expiration-time.expired {
    color: #dc3545;
}

/* Action buttons */
.bsv-actions {
    display: flex;
    gap: 0.75rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.bsv-btn {
    flex: 1;
    min-width: 140px;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    border: 2px solid;
}

.bsv-btn-primary {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.bsv-btn-primary:hover {
    background: #005a87;
    border-color: #005a87;
    transform: translateY(-1px);
}

.bsv-btn-secondary {
    background: transparent;
    border-color: rgba(0, 0, 0, 0.2);
}

.bsv-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

.bsv-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Explorer link */
.bsv-explorer-link {
    text-align: center;
    margin: 1rem 0;
    font-size: 13px;
}

.bsv-explorer-link a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.bsv-explorer-link a:hover {
    text-decoration: underline;
}

/* Payment details grid */
.bsv-payment-details {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
}

.bsv-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    font-size: 14px;
}

.bsv-detail-label {
    font-weight: 600;
    opacity: 0.7;
}

.bsv-detail-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Dark theme adjustments */
@media (prefers-color-scheme: dark) {
    .bsv-amount-section,
    .bsv-address-wrapper,
    .bsv-expiration,
    .bsv-detail-row {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .bsv-copy-btn {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    .bsv-copy-btn:hover {
        background: rgba(255, 255, 255, 0.12);
    }
    
    .bsv-qr-card {
        /* Keep QR card white for scan reliability */
        background: #fff;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
    }
}

/* Mobile responsive */
@media (max-width: 600px) {
    .bsv-payment-console {
        padding: 0 1rem;
    }
    
    .bsv-amount {
        font-size: 28px;
    }
    
    .bsv-qr-card {
        padding: 18px;
    }
    
    .bsv-actions {
        flex-direction: column;
    }
    
    .bsv-btn {
        width: 100%;
    }
    
    .bsv-address {
        font-size: 11px;
    }
}

/* Loading spinner */
.bsv-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: bsv-spin 0.6s linear infinite;
}

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

/* Confirmation progress */
.bsv-confirmations {
    margin: 1rem 0;
    text-align: center;
}

.bsv-conf-progress {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 0.5rem;
}

.bsv-conf-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.bsv-conf-dot.confirmed {
    background: #46b450;
    transform: scale(1.1);
}

.bsv-conf-dot.pending {
    background: #f0ad4e;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.bsv-conf-dot.partial {
    background: #ff9800;
    transform: scale(1.1);
}

.bsv-conf-dot.failed {
    background: #dc3545;
    transform: scale(1.1);
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.15);
    }
}

/* Gateway.cash Payment Button */
.bsv-gateway-button-container {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.gateway-paybutton-fixed {
    border-radius: 2em;
    border: 2px solid #2271b1;
    padding: 0.9em 2em;
    min-width: 12em;
    background: #2271b1;
    color: #ffffff;
    box-shadow: 2px 4px 6px rgba(0, 0, 0, 0.15);
    user-select: none;
    transition: all 0.3s ease;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    display: inline-block;
}

.gateway-paybutton-fixed:hover {
    box-shadow: 4px 8px 12px rgba(0, 0, 0, 0.25);
    background: #135e96;
    border-color: #135e96;
}

.gateway-paybutton-fixed.disabled {
    opacity: 1 !important;
    background: #2271b1 !important;
    border-color: #2271b1 !important;
    color: #ffffff !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.gateway-button-icon {
    font-size: 20px;
    line-height: 1;
    margin-right: 8px;
}

/* Dark theme support for Gateway button */
@media (prefers-color-scheme: dark) {
    .bsv-gateway-button-container {
        background: #2c2c2c;
    }
}
