/* Coinsoko WooCommerce Gateway Styles */

/* Payment method icon styling - matches Visa/PayPal icon size */
.wc_payment_method.payment_method_coinsoko label img,
.wc_payment_methods .wc_payment_method label[for="payment_method_coinsoko"] img {
    max-height: 32px !important;
    max-width: 48px !important;
    height: auto !important;
    width: auto !important;
    vertical-align: middle;
    margin-right: 8px !important;
}

.coinsoko-payment-fields {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.coinsoko-coin-selector {
    margin-bottom: 15px;
}

.coinsoko-coin-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

#coinsoko_coin {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    background: white;
    transition: border-color 0.3s ease;
}

#coinsoko_coin:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

#coinsoko_coin option {
    padding: 8px;
    font-size: 14px;
}

.coinsoko-amount-display {
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    color: white;
    text-align: center;
    margin-top: 15px;
}

.coinsoko-crypto-amount {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

.coinsoko-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: coinsoko-spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes coinsoko-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Payment Status Page */
.coinsoko-payment-status {
    max-width: 600px;
    margin: 20px auto;
    padding: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
}

.coinsoko-qr-container {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    display: inline-block;
}

.coinsoko-qr-code {
    max-width: 200px;
    height: auto;
    border: 2px solid #e1e1e1;
    border-radius: 4px;
}

.coinsoko-payment-details {
    margin: 20px 0;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 8px;
    text-align: left;
}

.coinsoko-payment-details h3 {
    margin-top: 0;
    color: #0073aa;
}

.coinsoko-address {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    word-break: break-all;
    margin: 10px 0;
}

.coinsoko-copy-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.coinsoko-copy-btn:hover {
    background: #005a87;
}

.coinsoko-status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    margin: 10px 0;
}

.coinsoko-status-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.coinsoko-status-confirmed {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #b8daff;
}

.coinsoko-status-failed {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .coinsoko-payment-fields {
        margin: 10px 0;
        padding: 12px;
    }
    
    #coinsoko_coin {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .coinsoko-payment-status {
        margin: 10px;
        padding: 20px;
    }
    
    .coinsoko-qr-code {
        max-width: 150px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .coinsoko-payment-fields {
        background: #2c2c2c;
        border-color: #444;
        color: #fff;
    }
    
    #coinsoko_coin {
        background: #333;
        border-color: #555;
        color: #fff;
    }
    
    .coinsoko-payment-details {
        background: #2a2a2a;
        color: #fff;
    }
    
    .coinsoko-address {
        background: #1a1a1a;
        border-color: #555;
        color: #fff;
    }
}

/* Additional styles for thankyou page */
.coinsoko-payment-info {
    display: grid;
    gap: 20px;
    margin-top: 15px;
}

.coinsoko-amount-section,
.coinsoko-address-section,
.coinsoko-qr-section,
.coinsoko-status-section {
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.coinsoko-amount-label,
.coinsoko-address-label,
.coinsoko-qr-label,
.coinsoko-status-label {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #333;
}

.coinsoko-coin-name {
    font-size: 14px;
    color: #666;
    margin-left: 5px;
}

.coinsoko-address-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.coinsoko-payment-address {
    flex: 1;
    padding: 10px;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    word-break: break-all;
}

.coinsoko-qr-loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-confirmed {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #b8daff;
}

.status-failed {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.coinsoko-instructions {
    margin-top: 20px;
    padding: 15px;
    background: #e8f4f8;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.coinsoko-instructions h4 {
    margin-top: 0;
    color: #0073aa;
}

.coinsoko-instructions ol {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.coinsoko-instructions li {
    margin: 8px 0;
    color: #333;
}

/* Dark mode for new elements */
@media (prefers-color-scheme: dark) {
    .coinsoko-amount-section,
    .coinsoko-address-section,
    .coinsoko-qr-section,
    .coinsoko-status-section {
        background: #333;
        border-color: #555;
    }
    
    .coinsoko-amount-label,
    .coinsoko-address-label,
    .coinsoko-qr-label,
    .coinsoko-status-label {
        color: #fff;
    }
    
    .coinsoko-payment-address {
        background: #2a2a2a;
        border-color: #555;
        color: #fff;
    }
    
    .coinsoko-instructions {
        background: #2a4d5a;
        border-left-color: #5bc0de;
    }
    
    .coinsoko-instructions h4 {
        color: #5bc0de;
    }
    
    .coinsoko-instructions li {
        color: #fff;
    }
}

/* Modal Styles */
.coinsoko-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.coinsoko-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.coinsoko-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.coinsoko-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 1000000;
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.3s ease;
}

.coinsoko-modal.active .coinsoko-modal-content {
    transform: scale(1);
    opacity: 1;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.coinsoko-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.coinsoko-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    flex: 1;
}

.coinsoko-modal-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    padding: 8px 12px;
    border-radius: 8px;
    order: 2;
    flex-basis: 100%;
}

.coinsoko-timer-label {
    font-size: 14px;
    color: #6b7280;
}

.coinsoko-timer-display {
    font-size: 16px;
    font-weight: 600;
    color: #059669;
    font-family: monospace;
}

.coinsoko-timer-display.warning {
    color: #d97706;
}

.coinsoko-timer-display.expired {
    color: #dc2626;
}

.coinsoko-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    order: 3;
}

.coinsoko-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.coinsoko-modal-body {
    padding: 24px;
}

/* Status Section */
.coinsoko-modal-status {
    margin-bottom: 24px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    text-align: center;
}

.coinsoko-status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.coinsoko-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.coinsoko-status-dot.pending {
    background: #fbbf24;
    animation: pulse 2s infinite;
}

.coinsoko-status-dot.confirming {
    background: #3b82f6;
    animation: pulse 1s infinite;
}

.coinsoko-status-dot.confirmed {
    background: #10b981;
}

.coinsoko-status-dot.failed {
    background: #ef4444;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

.coinsoko-status-text {
    font-weight: 500;
    color: #374151;
}

/* QR Code Section */
.coinsoko-modal-qr-section {
    text-align: center;
    margin-bottom: 24px;
}

.coinsoko-modal-qr-code {
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 8px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coinsoko-modal-qr-code canvas,
.coinsoko-modal-qr-code img {
    max-width: 100%;
    height: auto;
}

.coinsoko-qr-instruction {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    font-style: italic;
}

/* Payment Info Section */
.coinsoko-modal-payment-info {
    space-y: 16px;
}

.coinsoko-modal-payment-address-section,
.coinsoko-modal-amount-section,
.coinsoko-modal-network-section {
    margin-bottom: 16px;
}

.coinsoko-modal-payment-address-section label,
.coinsoko-modal-amount-section label,
.coinsoko-modal-network-section label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    font-size: 14px;
}

.coinsoko-modal-address-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.coinsoko-modal-payment-address {
    flex: 1;
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
    word-break: break-all;
}

.coinsoko-copy-address {
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.coinsoko-copy-address:hover {
    background: #2563eb;
}

.coinsoko-modal-crypto-amount,
.coinsoko-modal-network {
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-weight: 600;
    color: #111827;
}

/* Progress Steps */
.coinsoko-modal-progress {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.coinsoko-progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 16px;
}

.coinsoko-progress-steps::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #e5e7eb;
    z-index: 1;
}

.coinsoko-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.coinsoko-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.coinsoko-step.active .coinsoko-step-number {
    background: #3b82f6;
    color: white;
}

.coinsoko-step.completed .coinsoko-step-number {
    background: #10b981;
    color: white;
}

.coinsoko-step-text {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    font-weight: 500;
}

.coinsoko-step.active .coinsoko-step-text,
.coinsoko-step.completed .coinsoko-step-text {
    color: #374151;
}

.coinsoko-status-text {
    font-weight: 500;
    color: #374151;
}

/* Progress Steps */
.coinsoko-modal-progress {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.coinsoko-progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 16px;
}

.coinsoko-progress-steps::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #e5e7eb;
    z-index: 1;
}

.coinsoko-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.coinsoko-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.coinsoko-step.active .coinsoko-step-number {
    background: #3b82f6;
    color: white;
}

.coinsoko-step.completed .coinsoko-step-number {
    background: #10b981;
    color: white;
}

.coinsoko-step-text {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    font-weight: 500;
}

.coinsoko-step.active .coinsoko-step-text,
.coinsoko-step.completed .coinsoko-step-text {
    color: #374151;
}

.coinsoko-modal-payment-details > div {
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.coinsoko-modal-payment-details label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.coinsoko-modal-crypto-amount {
    font-size: 18px;
    font-weight: bold;
    color: #0073aa;
}

.coinsoko-modal-address-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.coinsoko-modal-payment-address {
    flex: 1;
    padding: 10px 12px;
    font-family: 'Courier New', monospace;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    word-break: break-all;
}

.coinsoko-modal-qr-code {
    text-align: center;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e1e1e1;
}

.coinsoko-modal-qr-code img {
    max-width: 200px;
    height: auto;
}

.coinsoko-modal-status {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 10px;
}

.coinsoko-modal-status-text {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.coinsoko-modal-instructions {
    background: #e8f4f8 !important;
    border-left: 4px solid #0073aa !important;
}

.coinsoko-modal-instructions h4 {
    margin: 0 0 12px 0;
    color: #0073aa;
    font-size: 16px;
}

.coinsoko-modal-instructions ol {
    margin: 0;
    padding-left: 20px;
}

.coinsoko-modal-instructions li {
    margin: 8px 0;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

/* Prevent body scroll when modal is open */
body.coinsoko-modal-open {
    overflow: hidden;
}

/* Mobile responsive modal */
@media (max-width: 768px) {
    .coinsoko-modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .coinsoko-modal-header,
    .coinsoko-modal-body {
        padding: 16px;
    }
    
    .coinsoko-modal-payment-details > div {
        padding: 12px;
    }
    
    .coinsoko-modal-address-container {
        flex-direction: column;
    }
    
    .coinsoko-modal-payment-address {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .coinsoko-modal-qr-code img {
        max-width: 150px;
    }
}

/* Dark mode modal styles */
@media (prefers-color-scheme: dark) {
    .coinsoko-modal-content {
        background: #2a2a2a;
        color: white;
    }
    
    .coinsoko-modal-header {
        border-bottom-color: #444;
    }
    
    .coinsoko-modal-header h3 {
        color: #5bc0de;
    }
    
    .coinsoko-modal-close {
        color: #ccc;
    }
    
    .coinsoko-modal-close:hover {
        background: #444;
        color: white;
    }
    
    .coinsoko-modal-payment-details > div {
        background: #333;
        border-color: #555;
    }
    
    .coinsoko-modal-payment-details label {
        color: white;
    }
    
    .coinsoko-modal-payment-address {
        background: #1a1a1a;
        border-color: #555;
        color: white;
    }
    
    .coinsoko-modal-qr-code {
        background: #1a1a1a;
        border-color: #555;
    }
    
    .coinsoko-modal-instructions {
        background: #2a4d5a !important;
        border-left-color: #5bc0de !important;
    }
    
    .coinsoko-modal-instructions h4 {
        color: #5bc0de;
    }
    
    .coinsoko-modal-instructions li {
        color: white;
    }
}