/**
 * WC Crypto Pay - Checkout Styles
 * Custom dropdown, compact payment layout, confirmation checkbox
 */

/* ============================================
   Checkout Container
   ============================================ */
#wc-crypto-pay-checkout-fields {
    margin-top: 12px;
}

/* ============================================
   Custom Dropdown
   ============================================ */
.crypto-coin-selector {
    margin-bottom: 16px;
}

.crypto-coin-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a1a2e;
    font-size: 14px;
}

.crypto-dropdown {
    position: relative;
}

.crypto-dropdown-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    min-height: 48px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.crypto-dropdown-selected:hover {
    border-color: #c7d2fe;
}

.crypto-dropdown.open .crypto-dropdown-selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    border-radius: 10px 10px 0 0;
}

.crypto-dropdown-placeholder {
    color: #94a3b8;
    font-size: 14px;
    flex: 1;
}

.crypto-dropdown-arrow {
    color: #94a3b8;
    transition: transform 0.2s;
    margin-left: auto;
}

.crypto-dropdown.open .crypto-dropdown-arrow {
    transform: rotate(180deg);
}

.crypto-dropdown-selected.has-value .crypto-option-name {
    font-weight: 700;
    color: #1e1b4b;
    font-size: 15px;
}

.crypto-dropdown-selected.has-value .crypto-option-network {
    font-size: 11px;
    color: #64748b;
}

.crypto-dropdown-options {
    display: none;
    /* position & coordinates set by JS (position:fixed) to escape modal overflow clipping */
    background: #fff;
    border: 2px solid #6366f1;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 10px 10px;
    max-height: 260px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.crypto-dropdown.open .crypto-dropdown-options {
    display: block;
}

.crypto-dropdown-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f1f5f9;
}

.crypto-dropdown-option:last-child {
    border-bottom: none;
}

.crypto-dropdown-option:hover {
    background: #eef2ff;
}

.crypto-dropdown-option.active {
    background: #e0e7ff;
}

.crypto-option-icon {
    border-radius: 50%;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
}

.crypto-option-icon-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    flex-shrink: 0;
}

.crypto-option-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.crypto-option-name {
    font-weight: 700;
    font-size: 14px;
    color: #1e1b4b;
    line-height: 1.3;
}

.crypto-option-network {
    font-size: 11px;
    color: #64748b;
    line-height: 1.3;
}

/* ============================================
   Loading State
   ============================================ */
.crypto-loading {
    text-align: center;
    padding: 30px 20px;
}

.crypto-spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 12px;
    border: 3px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: cryptoSpin 0.7s linear infinite;
}

@keyframes cryptoSpin {
    to { transform: rotate(360deg); }
}

.crypto-loading p {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

/* ============================================
   Payment Card
   ============================================ */
.crypto-payment-card {
    background: #f8fafc;
    border: 2px solid #e0e7ff;
    border-radius: 14px;
    overflow: hidden;
    margin-top: 8px;
}

.crypto-payment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: #fff;
}

.crypto-detail-icon {
    border-radius: 50%;
    background: #fff;
    padding: 2px;
    width: 36px;
    height: 36px;
}

.crypto-payment-title strong {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.crypto-network-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: #c7d2fe;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 10px;
    border-radius: 20px;
    margin-left: 8px;
    vertical-align: middle;
}

.crypto-payment-body {
    padding: 18px;
}

/* ============================================
   Compact Layout: QR left, Info right
   ============================================ */
.crypto-pay-layout {
    display: flex;
    gap: 18px;
    margin-bottom: 14px;
    align-items: flex-start;
}

.crypto-pay-qr-col {
    flex-shrink: 0;
}

.crypto-qr-code {
    display: inline-block;
    padding: 8px;
    background: #fff;
    border-radius: 10px;
    border: 2px solid #e0e7ff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.crypto-qr-code img,
.crypto-qr-code canvas {
    display: block;
    border-radius: 4px;
}

.crypto-pay-info-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.crypto-info-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crypto-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crypto-amount-value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.amount-number {
    font-size: 22px;
    font-weight: 800;
    color: #1e1b4b;
    font-family: 'SF Mono', 'Fira Mono', 'Roboto Mono', monospace;
    line-height: 1.2;
}

.amount-symbol {
    font-size: 14px;
    font-weight: 700;
    color: #6366f1;
}

.crypto-rate-info {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 0;
    line-height: 1.2;
}

.address-text {
    font-size: 11px;
    color: #1e1b4b;
    word-break: break-all;
    background: #f1f5f9;
    padding: 8px 10px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Fira Mono', 'Roboto Mono', monospace;
    border: 1px solid #e2e8f0;
    display: block;
    line-height: 1.4;
}

/* ============================================
   Copy Button (compact)
   ============================================ */
.crypto-copy-btn {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    padding: 4px 10px;
    color: #4338ca;
    font-weight: 600;
    transition: all 0.2s ease;
    align-self: flex-start;
    line-height: 1.4;
}

.crypto-copy-btn:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
}

.crypto-copy-btn.copied {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

/* ============================================
   Network Notice (compact)
   ============================================ */
.crypto-network-notice {
    text-align: center;
    font-size: 13px;
    color: #475569;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e7ff;
    margin-bottom: 12px;
}

/* ============================================
   Countdown (inline bar style)
   ============================================ */
.crypto-countdown-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e7ff;
    margin-bottom: 12px;
}

.countdown-label-inline {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.countdown-value-inline {
    font-size: 16px;
    font-weight: 800;
    color: #1e1b4b;
    font-family: 'SF Mono', 'Fira Mono', 'Roboto Mono', monospace;
    transition: color 0.3s;
}

.countdown-bar-track {
    flex: 1;
    min-width: 80px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.countdown-bar-fill {
    height: 100%;
    background: #6366f1;
    border-radius: 3px;
    transition: width 1s linear, background 0.3s;
    width: 100%;
}

.countdown-expired-text {
    width: 100%;
    color: #ef4444;
    font-weight: 600;
    font-size: 12px;
    margin-top: 4px;
    animation: cryptoPulse 1.5s ease-in-out infinite;
}

@keyframes cryptoPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   Confirmation Checkbox
   ============================================ */
.crypto-confirm-section {
    margin-bottom: 12px;
}

.crypto-confirm-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #eef2ff;
    border: 2px solid #c7d2fe;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    font-size: 13px;
    color: #1e1b4b;
    font-weight: 500;
    line-height: 1.4;
}

.crypto-confirm-label:hover {
    border-color: #6366f1;
    background: #e0e7ff;
}

.crypto-confirm-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
}

.crypto-confirm-label input[type="checkbox"]:checked + span {
    color: #312e81;
    font-weight: 600;
}

/* ============================================
   Warning Notice
   ============================================ */
.crypto-warning {
    background: #fffbeb;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 10px 14px;
}

.crypto-warning p {
    margin: 0;
    font-size: 12px;
    color: #92400e;
    line-height: 1.5;
}

/* ============================================
   Error State
   ============================================ */
.crypto-error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
    font-size: 13px;
}

.wc-crypto-pay-no-coins {
    color: #64748b;
    font-style: italic;
}

/* ============================================
   Thank You Page
   ============================================ */
.crypto-pay-thankyou-box {
    background: #f8fafc;
    border: 2px solid #e0e7ff;
    border-radius: 14px;
    padding: 24px;
    margin: 24px 0;
}

.crypto-pay-thankyou-box h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    color: #1e1b4b;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e0e7ff;
}

.crypto-coin-icon {
    border-radius: 50%;
}

.crypto-pay-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.crypto-info-item {
    background: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid #e0e7ff;
}

.crypto-info-item .crypto-label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.crypto-info-item .crypto-value {
    font-size: 14px;
    font-weight: 600;
    color: #1e1b4b;
    word-break: break-all;
}

.crypto-info-item .crypto-amount {
    font-family: 'SF Mono', 'Fira Mono', 'Roboto Mono', monospace;
    color: #6366f1;
    font-weight: 700;
}

.crypto-info-item .crypto-address {
    font-family: 'SF Mono', 'Fira Mono', 'Roboto Mono', monospace;
    font-size: 12px;
}

.crypto-pay-thankyou-box .crypto-qr-section {
    text-align: center;
    margin-bottom: 20px;
}

.crypto-pay-thankyou-box .crypto-qr-section #crypto-thankyou-qrcode {
    display: inline-block;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 2px solid #e0e7ff;
}

.crypto-pay-thankyou-box .crypto-countdown-section {
    text-align: center;
    margin-bottom: 20px;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e0e7ff;
}

.crypto-pay-thankyou-box .countdown-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crypto-pay-thankyou-box .countdown-timer {
    margin: 8px 0;
}

.crypto-pay-thankyou-box .countdown-value {
    font-size: 32px;
    font-weight: 800;
    color: #1e1b4b;
    font-family: 'SF Mono', 'Fira Mono', 'Roboto Mono', monospace;
}

.crypto-countdown-expired {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
    margin-bottom: 20px;
}

.crypto-countdown-expired p {
    margin: 0;
    color: #dc2626;
    font-weight: 500;
}

.crypto-pay-notice {
    background: #fffbeb;
    border: 1px solid #fed7aa;
    border-radius: 10px;
    padding: 12px 16px;
}

.crypto-pay-notice p {
    margin: 0;
    font-size: 13px;
    color: #92400e;
    line-height: 1.5;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
    .crypto-pay-layout {
        flex-direction: column;
        align-items: center;
    }

    .crypto-pay-info-col {
        width: 100%;
    }

    .crypto-pay-info-grid {
        grid-template-columns: 1fr;
    }

    .amount-number {
        font-size: 18px;
    }

    .crypto-payment-body {
        padding: 14px;
    }
}
