/**
 * PYUSD Payment Gateway Styles
 * 
 * @package PYUSD_Payment_Watcher
 */

/* Payment form container */
#wc-pyusd_payment-form {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 10px;
}

/* Network selection dropdown */
#pyusd_network {
    width: 22% !important;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
}

#pyusd_network:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/* Network details sections */
.pyusd-network-details {
    margin: 15px 0;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Wallet info section */
.pyusd-wallet-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Reorder elements: QR code first, then title, then address */
.pyusd-wallet-info>p {
    order: 2;
    padding-left: unset !important;
}

.pyusd-wallet-info .pyusd-address-box {
    order: 3;
}

.pyusd-wallet-info .pyusd-qr-code {
    order: 1;
    margin-top: 0;
    margin-bottom: 15px;
    padding-top: 0;
    border-top: none;
}

.pyusd-wallet-info>p {
    margin-bottom: 10px;
    color: #333;
}

/* Address box with copy button */
.pyusd-address-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
}

.pyusd-address-box code {
    display: inline-block;
    padding: 10px 15px;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 12px;
    word-break: break-all;
    max-width: 100%;
    color: #495057;
    font-family: 'Courier New', Courier, monospace;
}

/* Copy button */
.pyusd-copy-btn {
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.pyusd-copy-btn:hover {
    background: #005a87;
}

.pyusd-copy-btn:active {
    background: #004466;
}

.pyusd-copy-btn.copied {
    background: #28a745;
}

/* QR Code section */
.pyusd-qr-code {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pyusd-qr-code img {
    display: block;
    margin: 0 auto;
    border: 4px solid #fff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    max-height: unset !important;
}

/* Transaction hash input */
#pyusd_transaction_hash {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
}

#pyusd_transaction_hash:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

#pyusd_transaction_hash::placeholder {
    color: #999;
    font-family: inherit;
}

/* Hash help text */
.pyusd-hash-help {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 12px;
    font-style: italic;
}

/* Thank you page payment details */
.pyusd-payment-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #0073aa;
}

.pyusd-payment-details h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.pyusd-payment-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pyusd-payment-details li {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.pyusd-payment-details li:last-child {
    border-bottom: none;
}

.pyusd-payment-details code {
    display: inline-block;
    background: #e9ecef;
    padding: 5px 10px;
    border-radius: 4px;
    word-break: break-all;
    font-size: 12px;
}

.pyusd-payment-details a {
    color: #0073aa;
    text-decoration: none;
}

.pyusd-payment-details a:hover {
    text-decoration: underline;
}

/* Test mode notice */
#wc-pyusd_payment-form strong {
    color: #856404;
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .pyusd-address-box {
        flex-direction: column;
    }

    .pyusd-address-box code {
        font-size: 11px;
    }

    .pyusd-copy-btn {
        width: 100%;
    }

    .pyusd-qr-code img {
        max-width: 180px;
    }

    #pyusd_network {
        width: 100%;
    }

    #wc-pyusd_payment-form strong {
        padding: unset;
        font-size: small;
    }
}

/* Admin meta box styles */
.pyusd-admin-meta-box code {
    display: block;
    background: #f0f0f0;
    padding: 8px;
    margin: 5px 0;
    word-break: break-all;
    font-size: 11px;
}

/* ==========================================================================
   Popup Modal Styles
   ========================================================================== */

/* Popup trigger button */
.pyusd-popup-trigger {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0073aa, #005a87);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
    margin: 10px 0;
}

.pyusd-popup-trigger:hover {
    background: linear-gradient(135deg, #005a87, #004466);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4);
}

/* Modal overlay */
.pyusd-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
}

.pyusd-modal-overlay.active {
    display: flex;
}

/* Modal container */
.pyusd-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    position: relative;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal header */
.pyusd-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px 12px 0 0;
}

.pyusd-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

/* Close button */
.pyusd-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.pyusd-modal-close:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.1);
}

/* Modal body */
.pyusd-modal-body {
    padding: 24px;
}

.pyusd-modal-body .pyusd-wallet-info {
    text-align: center;
}

.pyusd-modal-body .pyusd-address-box {
    flex-direction: column;
    gap: 12px;
}

.pyusd-modal-body .pyusd-address-box code {
    font-size: 11px;
    padding: 12px;
    background: #f0f4f8;
    border: 2px solid #e1e8ed;
}

.pyusd-modal-body .pyusd-qr-code {
    margin-top: 20px;
    padding-top: 20px;
    text-align: center;
}

.pyusd-modal-body .pyusd-qr-code img {
    width: 180px;
    height: 180px;
    border: 4px solid #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
}

/* Inline content hidden when popup mode is active */
.pyusd-popup-mode .pyusd-network-details {
    display: none !important;
}

/* Network indicator in popup */
.pyusd-network-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #e8f4fd;
    color: #0073aa;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
}

.pyusd-network-badge.solana {
    background: #f0e8fd;
    color: #7c3aed;
}