/* Crypto Payment Gateway - Dropdown Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ===== BASE STYLES ===== */
.crypto-payment-section {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 20px 0;
    width: 100%;
}

.crypto-premium-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 25px 20px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.crypto-header {
    margin-bottom: 20px;
}

.crypto-title-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.crypto-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin: 0;
    line-height: 1.4;
}

.crypto-description {
    font-size: 14px;
    color: #646970;
    margin: 10px 0 0 0;
    line-height: 1.5;
}

/* ===== FIXED: Payment Method Row - Radio and Title in ONE LINE ===== */
.woocommerce-checkout .payment_method_crypto_payment {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
    padding: 10px 0 !important;
}

.woocommerce-checkout .payment_method_crypto_payment input[type="radio"] {
    margin: 0 5px 0 0 !important;
    flex-shrink: 0 !important;
    position: relative !important;
    top: 0 !important;
}

.woocommerce-checkout .payment_method_crypto_payment label {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
}

.woocommerce-checkout .payment_method_crypto_payment label img.crypto-payment-icon,
.woocommerce-checkout .payment_method_crypto_payment img.crypto-payment-icon {
    margin: 0 5px !important;
    vertical-align: middle !important;
}

/* Override WooCommerce default styles */
.woocommerce-checkout .wc_payment_methods .payment_method_crypto_payment label {
    display: inline-flex !important;
}

/* ===== MULTIPLE PAYMENT ICONS ===== */
.payment_method_crypto_payment label {
    display: inline-flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.payment_method_crypto_payment label img.crypto-payment-icon,
img.crypto-payment-icon {
    object-fit: contain !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 5px !important;
    border-radius: 6px !important;
    float: none !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.payment_method_crypto_payment label img.crypto-payment-icon:hover,
img.crypto-payment-icon:hover {
    transform: scale(1.1);
}

.woocommerce-checkout .payment_method_crypto_payment img {
    object-fit: contain !important;
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 5px !important;
}

/* ===== QR CODES ===== */
.crypto-qr-image {
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

/* ===== UNIVERSAL DROPDOWN SOLUTION ===== */
.crypto-coin-selection {
    margin-bottom: 20px;
}

.crypto-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 10px;
}

.crypto-label .required {
    color: #d63638;
    margin-left: 3px;
}

.crypto-dropdown-wrapper {
    position: relative;
    width: 100%;
    max-width: 450px;
}

.crypto-dropdown {
    width: 100%;
    font-size: 15px;
    color: #1d2327 !important;
    background: #fff !important;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 8px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    cursor: pointer !important;
    font-family: inherit !important;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    background-size: 16px !important;
    
    /* Force consistent sizing */
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    padding: 0 16px !important;
    line-height: 48px !important;
    box-sizing: border-box !important;
    
    /* Override any theme styles */
    margin: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    text-indent: 0 !important;
    
    /* Ensure text is vertically centered */
    display: block !important;
}

/* Override for any theme that tries to be fancy */
.crypto-dropdown:focus,
.crypto-dropdown:hover,
.crypto-dropdown:active {
    border-color: #2271b1 !important;
    box-shadow: 0 0 0 1px #2271b1 !important;
    outline: none !important;
}

/* Fix for Firefox */
@-moz-document url-prefix() {
    .crypto-dropdown {
        text-indent: 0 !important;
        padding: 0 16px !important;
    }
}

/* Fix for IE/Edge */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .crypto-dropdown {
        padding: 0 16px !important;
        line-height: 48px !important;
    }
}

/* Fix for Safari */
_::-webkit-full-page-media, _:future, :root .crypto-dropdown {
    padding: 0 16px !important;
}

/* Ensure dropdown options are visible */
.crypto-dropdown option {
    color: #1d2327 !important;
    background: #fff !important;
    font-size: 15px !important;
    padding: 12px 16px !important;
    min-height: 48px !important;
}

/* Fix for placeholder option */
.crypto-dropdown option[value=""] {
    color: #757575 !important;
}

/* Fix for selected value visibility */
.crypto-dropdown:valid {
    color: #1d2327 !important;
}

.crypto-coin-error {
    background: #fcf0f1;
    color: #d63638;
    padding: 10px 15px;
    border-radius: 4px;
    border: 1px solid #fababa;
    font-size: 13px;
    margin-top: 10px;
    display: none;
}

/* ===== TOTAL AMOUNT SECTION ===== */
.crypto-total-section {
    background: linear-gradient(145deg, #fafafa, #f5f5f5);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid #e8e8e8;
}

.crypto-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.crypto-total-label {
    font-size: 15px;
    font-weight: 500;
    color: #555;
}

.crypto-total-amount {
    font-size: 24px;
    font-weight: 700;
    color: #000;
}

.crypto-payable-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 12px;
    border-top: 1px dashed #ccc;
}

.crypto-payable-label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.crypto-payable-amount {
    font-size: 18px;
    font-weight: 700;
    color: #f7931a;
    background: rgba(247, 147, 26, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
}

/* ===== QR CODE SECTION - CENTERED ===== */
.crypto-qr-section {
    text-align: center;
    margin-bottom: 25px;
    padding: 15px;
    background: #fff;
    border-radius: 12px;
}

.crypto-qr-container {
    display: inline-block;
    background: #fff;
    padding: 15px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 15px;
}

.crypto-qr-container img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    display: block;
}

.crypto-qr-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.crypto-qr-note {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* ===== ADDRESS SECTION - CLEAN FORMAT ===== */
.crypto-address-vault {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.crypto-vault-header {
    margin-bottom: 15px;
    text-align: left;
}

.crypto-vault-label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.crypto-vault-label:before {
    content: "📋";
    font-size: 16px;
}

.crypto-address-wrapper {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 15px;
    word-break: break-all;
    position: relative;
}

.crypto-address-text {
    font-family: 'Courier New', 'SF Mono', Monaco, monospace;
    font-size: 15px;
    color: #2c3e50;
    line-height: 1.6;
    display: block;
    letter-spacing: 0.5px;
    background: #fff;
}

/* ===== ADDRESS TYPE BADGE - FIXED ===== */
.crypto-address-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    line-height: 1.4;
}

.crypto-address-type-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

/* Native Segwit, Segwit, Legacy, Taproot */
.crypto-address-type-badge[data-type="Native Segwit"],
.crypto-address-type-badge[data-type="Segwit"],
.crypto-address-type-badge[data-type="Legacy"],
.crypto-address-type-badge[data-type="Taproot"] {
    background: #e6f7e6 !important;
    color: #0a5c0a !important;
    border-color: #a3d8a3 !important;
}

/* ERC-20 */
.crypto-address-type-badge[data-type="ERC-20"] {
    background: #e6f0ff !important;
    color: #1e40af !important;
    border-color: #b8d1ff !important;
}

/* BEP-20 */
.crypto-address-type-badge[data-type="BEP-20"] {
    background: #fff4e6 !important;
    color: #b45309 !important;
    border-color: #ffd7b3 !important;
}

/* TRC-20 */
.crypto-address-type-badge[data-type="TRC-20"] {
    background: #f3e6ff !important;
    color: #6b21a8 !important;
    border-color: #d9b3ff !important;
}

/* Solana */
.crypto-address-type-badge[data-type="Solana"] {
    background: #f3e8ff !important;
    color: #9945FF !important;
    border-color: #d6b3ff !important;
}

/* Polygon */
.crypto-address-type-badge[data-type="Polygon"] {
    background: #e6f3ff !important;
    color: #6f42c1 !important;
    border-color: #c2b3ff !important;
}

/* Arbitrum */
.crypto-address-type-badge[data-type="Arbitrum"] {
    background: #e6f0fa !important;
    color: #28a0f0 !important;
    border-color: #b8d9ff !important;
}

/* Optimism */
.crypto-address-type-badge[data-type="Optimism"] {
    background: #f2e6ff !important;
    color: #ff0420 !important;
    border-color: #ffb3b3 !important;
}

/* Base */
.crypto-address-type-badge[data-type="Base"] {
    background: #e6f0ff !important;
    color: #0052ff !important;
    border-color: #b8d1ff !important;
}

/* Avalanche */
.crypto-address-type-badge[data-type="Avalanche"] {
    background: #ffe6e6 !important;
    color: #e84142 !important;
    border-color: #ffb3b3 !important;
}

/* Fantom */
.crypto-address-type-badge[data-type="Fantom"] {
    background: #e6f7f0 !important;
    color: #1969ff !important;
    border-color: #b8e6d9 !important;
}

/* Cronos */
.crypto-address-type-badge[data-type="Cronos"] {
    background: #e6f7f7 !important;
    color: #002d74 !important;
    border-color: #b3e6e6 !important;
}

/* Standard */
.crypto-address-type-badge[data-type="Standard"] {
    background: #f0f6fc !important;
    color: #2271b1 !important;
    border-color: #c5d9ed !important;
}

/* Custom Type */
.crypto-address-type-badge[data-type*="custom"] {
    background: #f3e6ff !important;
    color: #6b21a8 !important;
    border-color: #d9b3ff !important;
}

/* ===== COPY BUTTON ===== */
.crypto-copy-btn {
    width: 100%;
    background: #2271b1;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid #2271b1;
}

.crypto-copy-btn:hover {
    background: #135e96;
    border-color: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.2);
}

.crypto-copy-btn svg {
    width: 18px;
    height: 18px;
    stroke: white;
}

.crypto-copy-btn.success {
    background: #00a32a !important;
    border-color: #00a32a !important;
}

.crypto-copy-btn.success svg {
    stroke: white;
}

/* ===== TRANSACTION SECTION - HIDDEN BY DEFAULT ===== */
.crypto-transaction-section {
    display: none;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 20px;
    margin-top: 0;
}

.crypto-transaction-section.visible,
.crypto-transaction-section[style*="display: block"] {
    display: block !important;
}

.crypto-transaction-section::before {
    display: none;
}

.crypto-transaction-label {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.crypto-transaction-label:before {
    content: "🔗";
    font-size: 16px;
}

.crypto-transaction-label .required {
    color: #d63638;
    margin-left: 3px;
}

/* ===== TRANSACTION ID FIELD - REQUIRED ===== */
#crypto_transaction {
    width: 100%;
    background: #fff !important;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 14px 16px !important;
    font-size: 14px !important;
    font-family: 'Courier New', monospace !important;
    color: #333 !important;
    box-sizing: border-box !important;
    transition: all 0.2s;
}

#crypto_transaction:focus {
    border-color: #2271b1 !important;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1) !important;
    outline: none !important;
}

#crypto_transaction.valid {
    border-color: #00a32a !important;
    background: #f0fff0 !important;
}

#crypto_transaction.error {
    border-color: #d63638 !important;
    background: #fcf0f1 !important;
}

/* ===== HELP TEXT WITH REQUIRED INDICATOR ===== */
.crypto-help-text {
    font-size: 12px;
    color: #888;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.crypto-help-text .required {
    color: #d63638;
    font-weight: 600;
    margin-left: 2px;
}

.crypto-help-text:before {
    content: "ⓘ";
    font-size: 14px;
}

/* ===== PAYMENT DETAILS - HIDDEN BY DEFAULT ===== */
#crypto-payment-details {
    display: none;
}

/* ===== LOADING STATE ===== */
.crypto-loading-state {
    text-align: center;
    padding: 50px 20px;
    background: #fff;
    border-radius: 12px;
}

.crypto-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f0f0f0;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== ERROR STATE ===== */
.crypto-error-state {
    background: #fcf0f1;
    border: 1px solid #fababa;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
}

.crypto-error-state p {
    color: #d63638;
    margin: 0;
    font-size: 14px;
}

/* ===== HIDE DECORATIVE ELEMENTS ===== */
.crypto-payment-badge,
.crypto-screen-balance,
.crypto-secure-note,
.crypto-payment-footer,
.crypto-payment-title svg,
.crypto-vault-label svg,
.crypto-input-icon,
.crypto-vault-badge,
.crypto-hardware-display .crypto-screen-header svg,
.crypto-dropdown-arrow {
    display: none !important;
}

/* ===== MAIN PAYMENT SECTION CONTROLS ===== */
/* Main container hidden by default - shown via JS when payment method selected */
.crypto-payment-section {
    display: none;
}

/* When payment method is selected, show the section */
.crypto-payment-section[style*="display: block"] {
    display: block !important;
}

/* Dropdown always visible when section is shown */
.crypto-payment-section .crypto-coin-selection {
    display: block !important;
}

/* Hide all other sections by default - they will be shown via JS after coin selection */
.crypto-payment-section .crypto-payment-details,
.crypto-payment-section .crypto-transaction-section,
.crypto-payment-section .crypto-total-section {
    display: none !important;
}

/* Show when JS adds display block */
.crypto-payment-section .crypto-payment-details[style*="display: block"],
.crypto-payment-section .crypto-transaction-section[style*="display: block"],
.crypto-payment-section .crypto-total-section[style*="display: block"] {
    display: block !important;
}

/* Smooth transitions */
.crypto-payment-details,
.crypto-transaction-section,
.crypto-total-section {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Loading state styling */
.crypto-loading-state {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 20px 0;
}

/* ===== RESPONSIVE FOR ALL DEVICES ===== */

/* Desktop Large (1200px+) */
@media (min-width: 1200px) {
    .crypto-premium-card {
        padding: 30px;
    }
    
    .crypto-qr-container img {
        width: 200px;
        height: 200px;
    }
    
    .crypto-address-text {
        font-size: 16px;
    }
}

/* Desktop Small (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .crypto-premium-card {
        padding: 25px;
    }
    
    .crypto-qr-container img {
        width: 180px;
        height: 180px;
    }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .crypto-premium-card {
        padding: 20px;
    }
    
    .crypto-total-amount {
        font-size: 22px;
    }
    
    .crypto-payable-amount {
        font-size: 16px;
    }
    
    .crypto-qr-container img {
        width: 160px;
        height: 160px;
    }
    
    .crypto-address-text {
        font-size: 14px;
        word-break: break-all;
    }
}

/* Mobile Large (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .crypto-premium-card {
        padding: 18px;
    }
    
    .crypto-total-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .crypto-payable-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .crypto-payable-amount {
        padding: 4px 12px;
        font-size: 15px;
    }
    
    .crypto-qr-container img {
        width: 150px;
        height: 150px;
    }
    
    .crypto-address-wrapper {
        padding: 12px;
    }
    
    .crypto-address-text {
        font-size: 13px;
        word-break: break-all;
        white-space: normal;
    }
    
    .payment_method_crypto_payment label {
        flex-wrap: wrap;
    }
}

/* Mobile Small (375px - 575px) */
@media (min-width: 375px) and (max-width: 575px) {
    .crypto-premium-card {
        padding: 15px;
    }
    
    .crypto-total-amount {
        font-size: 20px;
    }
    
    .crypto-payable-amount {
        font-size: 14px;
        padding: 4px 10px;
    }
    
    .crypto-qr-container {
        padding: 10px;
    }
    
    .crypto-qr-container img {
        width: 140px;
        height: 140px;
    }
    
    .crypto-qr-title {
        font-size: 16px;
    }
    
    .crypto-qr-note {
        font-size: 13px;
    }
    
    .crypto-address-vault {
        padding: 15px;
    }
    
    .crypto-address-wrapper {
        padding: 10px;
    }
    
    .crypto-address-text {
        font-size: 12px;
        line-height: 1.5;
    }
    
    .crypto-copy-btn {
        padding: 12px;
        font-size: 14px;
    }
    
    #crypto_transaction {
        padding: 12px !important;
        font-size: 13px !important;
    }
    
    .crypto-address-type-badge {
        padding: 4px 12px;
        font-size: 12px;
    }
}

/* Mobile Extra Small (below 375px) */
@media (max-width: 374px) {
    .crypto-premium-card {
        padding: 12px;
    }
    
    .crypto-dropdown {
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        line-height: 44px !important;
        font-size: 14px;
    }
    
    .crypto-total-amount {
        font-size: 18px;
    }
    
    .crypto-payable-amount {
        font-size: 13px;
        padding: 3px 8px;
    }
    
    .crypto-qr-container {
        padding: 8px;
    }
    
    .crypto-qr-container img {
        width: 120px;
        height: 120px;
    }
    
    .crypto-qr-title {
        font-size: 15px;
    }
    
    .crypto-qr-note {
        font-size: 12px;
    }
    
    .crypto-address-vault {
        padding: 12px;
    }
    
    .crypto-address-wrapper {
        padding: 8px;
        margin-bottom: 12px;
    }
    
    .crypto-address-text {
        font-size: 11px;
        line-height: 1.4;
    }
    
    .crypto-copy-btn {
        padding: 10px;
        font-size: 13px;
    }
    
    .crypto-transaction-section {
        padding: 15px;
    }
    
    #crypto_transaction {
        padding: 10px !important;
        font-size: 12px !important;
    }
    
    .crypto-help-text {
        font-size: 11px;
    }
    
    .crypto-address-type-badge {
        padding: 3px 10px;
        font-size: 11px;
    }
}

/* Landscape Mode */
@media (orientation: landscape) and (max-height: 600px) {
    .crypto-premium-card {
        padding: 15px;
    }
    
    .crypto-qr-container img {
        width: 120px;
        height: 120px;
    }
    
    .crypto-address-text {
        font-size: 12px;
    }
}

/* Print Styles */
@media print {
    .crypto-copy-btn,
    .crypto-qr-section,
    .crypto-transaction-section {
        display: none !important;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .crypto-premium-card {
        background: #1e1e1e;
        border-color: #333;
    }
    
    .crypto-title,
    .crypto-label,
    .crypto-total-amount,
    .crypto-qr-title,
    .crypto-address-text {
        color: #fff;
    }
    
    .crypto-description,
    .crypto-total-label,
    .crypto-payable-label,
    .crypto-qr-note,
    .crypto-help-text {
        color: #ccc;
    }
    
    .crypto-total-section,
    .crypto-address-vault,
    .crypto-transaction-section {
        background: #2d2d2d;
        border-color: #444;
    }
    
    .crypto-address-wrapper,
    .crypto-qr-container {
        background: #1e1e1e;
        border-color: #444;
    }
    
    .crypto-dropdown {
        background: #2d2d2d !important;
        color: #fff !important;
        border-color: #444 !important;
    }
    
    .crypto-dropdown option {
        background: #2d2d2d !important;
        color: #fff !important;
    }
}