/**
 * EDD Crypto Gateway - Checkout Styles
 */

/* Hide default form when Elementor widget is present */
.edd-crypto-payment-widget.elementor-widget-instance ~ #edd-crypto-payment-form {
    display: none !important;
}

/* When Elementor widget is on the checkout page */
body.edd-checkout .elementor-widget-edd-crypto-payment #edd-crypto-payment-form {
    display: none !important;
}

/* Currency selector with radio buttons (checkout) */
.edd-crypto-currency-selector.with-radio {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.edd-crypto-currency-label {
    display: block;
    cursor: pointer;
}

.edd-crypto-currency-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.edd-crypto-currency-label input[type="radio"]:checked + .edd-crypto-currency-option {
    border-color: #3498db;
    background: #e3f2fd;
}

/* Container Styles */
.edd-crypto-payment-widget {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.edd-crypto-title {
    margin: 0 0 10px;
    font-size: 24px;
    color: #2c3e50;
}

.edd-crypto-description {
    color: #00FFFF; 
    margin-bottom: 20px;
}

/* Currency Selector */
.edd-crypto-currency-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

#edd-crypto-payment-form .edd-crypto-currency-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#edd-crypto-payment-form .edd-crypto-currency-selector label {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #a7a0a0;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#edd-crypto-payment-form .edd-crypto-currency-selector label:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

#edd-crypto-payment-form .edd-crypto-currency-selector input[type="radio"] {
    margin-right: 10px;
}

#edd-crypto-payment-form .edd-crypto-currency-selector input[type="radio"]:checked + .edd-crypto-currency-option {
    font-weight: 600;
}

.edd-crypto-currency-option {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 10px;
}

.edd-crypto-currency-option:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.edd-crypto-currency-option.active {
    border-color: #3498db;
    background: #e3f2fd;
}

.edd-crypto-currency-option img,
.edd-crypto-currency-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.edd-crypto-currency-name {
    font-weight: 500;
    color: #2c3e50;
}

/* Price Display */
.edd-crypto-price-display {
    background: #1e1e1e;
    
    padding: 20px;
    margin-top: 20px;
}

.edd-crypto-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 16px;
}

.edd-crypto-price-label {
    color: #6c757d;
}

.edd-crypto-amount {
    font-size: 24px;
    font-weight: 600;
    color: #27ae60;
}

.edd-crypto-exchange-rate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #6c757d;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.edd-crypto-rate {
    color: #495057;
}

/* Payment Instructions */
.edd-crypto-instructions {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.edd-crypto-payment-details h4 {
    margin: 0 0 20px;
    color: #2c3e50;
    font-size: 20px;
}

.edd-crypto-amount-to-pay {
    background: #e8f5e9;
    border: 1px solid #c3e6c3;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edd-crypto-amount-to-pay strong {
    font-size: 28px;
    color: #27ae60;
}

/* Wallet Section */
.edd-crypto-wallet-section {
    margin-bottom: 25px;
}

.edd-crypto-wallet-section p {
    margin-bottom: 10px;
    font-weight: 500;
    color: #495057;
}

.edd-crypto-wallet-address {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    word-break: break-all;
    margin-bottom: 10px;
    color: #495057;
}

.edd-crypto-copy-address {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.edd-crypto-copy-address:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* QR Code Section */
.edd-crypto-qr-section {
    text-align: center;
    margin: 30px 0;
}

.edd-crypto-qr-code {
    display: inline-block;
    padding: 15px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.edd-crypto-qr-code canvas {
    display: block !important;
}

/* Status Section */
.edd-crypto-status-section {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.edd-crypto-status-message {
    margin-bottom: 15px;
    font-size: 16px;
    color: #495057;
}

.edd-crypto-status-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Transaction Input */
.edd-crypto-transaction-input {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.edd-crypto-transaction-input label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #495057;
}

.edd-crypto-transaction-input input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 10px;
}

.edd-crypto-transaction-input button {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.edd-crypto-transaction-input button:hover {
    background: #218838;
}

.edd-crypto-transaction-input button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Success Message */
.edd-crypto-success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 20px;
    border-radius: 8px;
    font-size: 18px;
    text-align: center;
}

.edd-crypto-icon-check {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: #28a745;
    border-radius: 50%;
    position: relative;
    margin-right: 10px;
}

.edd-crypto-icon-check::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .edd-crypto-currency-selector {
        flex-direction: column;
    }
    
    .edd-crypto-currency-option {
        width: 100%;
    }
    
    .edd-crypto-price-row,
    .edd-crypto-exchange-rate {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .edd-crypto-amount-to-pay {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .edd-crypto-wallet-address {
        font-size: 12px;
    }
}

/* Elementor Widget Specific Styles */
.elementor-widget-edd-crypto-payment .edd-crypto-currency-selector[style*="display: vertical"] {
    flex-direction: column;
}

.elementor-widget-edd-crypto-payment .edd-crypto-currency-selector[style*="display: grid"] {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* Loading State */
.edd-crypto-loading {
    opacity: 0.6;
    pointer-events: none;
}

.edd-crypto-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Error State */
.edd-crypto-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
}

/* Transitions */
* {
    transition-property: background-color, border-color, color, transform, opacity;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}