/* =============================================================
   WooWallet Pro — Withdrawal Frontend Styles
   Renders inside .woo-wallet-my-wallet-container — inherits
   core design tokens (CSS variables, form-wrapper, table classes).
   Only withdrawal-specific additions are defined here.
   ============================================================= */

/* Fallback tokens if rendered outside the wallet container.
   Declared on a parent-less selector so it doesn't shadow the
   inherited values from .woo-wallet-my-wallet-container. */
.woo-wallet-withdrawal-panel:not(.woo-wallet-my-wallet-container .woo-wallet-withdrawal-panel) {
    --wallet-primary-color: #483DE0;
    --wallet-border-color: #eee;
    --wallet-text-color: #333;
}

/* ── Panel wrapper (sits inside .woo-wallet-content-area) ──── */
.woo-wallet-withdrawal-panel .woo-wallet-withdrawal-inner {
    padding: 30px;
}

/* ── Withdrawable amount summary card ──────────────────────── */
.woo-wallet-withdrawal-summary {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 26px;
    border-radius: 14px;
    background: linear-gradient(135deg, #483DE0 0%, #6A5CF0 100%);
    color: #fff;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(72, 61, 224, 0.18);
}

.woo-wallet-withdrawal-summary__icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.woo-wallet-withdrawal-summary__icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    line-height: 28px;
    color: #fff;
}

.woo-wallet-withdrawal-summary__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.woo-wallet-withdrawal-summary__label {
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    opacity: 0.92;
    text-transform: uppercase;
}

.woo-wallet-withdrawal-summary__amount {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
}

.woo-wallet-withdrawal-summary__amount .amount,
.woo-wallet-withdrawal-summary__amount bdi {
    color: #fff;
}

.woo-wallet-withdrawal-summary__action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.woo-wallet-withdrawal-summary__action:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.woo-wallet-withdrawal-summary__action .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
}

/* ── Inline alerts / notices ─────────────────────────────────── */
.woo-wallet-withdrawal-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.woo-wallet-withdrawal-alert .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 20px;
    flex: 0 0 auto;
    margin-top: 2px;
}

.woo-wallet-withdrawal-alert--info {
    background: #eef0ff;
    border: 1px solid #d7dcff;
    color: #3530a8;
}

.woo-wallet-withdrawal-alert--warning {
    background: #fff8e1;
    border: 1px solid #ffd966;
    color: #8a6100;
}

/* ── Form rows ───────────────────────────────────────────────── */
.woo-wallet-withdrawal-fieldrow {
    margin-bottom: 22px;
}

.woo-wallet-withdrawal-fieldrow label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.woo-wallet-withdrawal-hint {
    display: block;
    margin-top: 6px;
    color: #7f8c8d;
    font-size: 0.85rem;
}

/* ── Currency input group ──────────────────────────────────── */
.woo-wallet-currency-input-group {
    display: flex;
    align-items: stretch;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    background: #f9f9f9;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.woo-wallet-currency-input-group:focus-within {
    border-color: var(--wallet-primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(72, 61, 224, 0.12);
}

.woo-wallet-currency-input-group .wallet_input_group_addon {
    display: flex;
    align-items: center;
    padding: 0 18px;
    background: transparent;
    border-right: 1px solid #e0e0e0;
    font-size: 1rem;
    color: #555;
    font-weight: 600;
    white-space: nowrap;
}

.woo-wallet-withdrawal-panel .woo-wallet-form-wrapper .woo-wallet-currency-input-group input[type="number"] {
    flex: 1;
    border: 0 !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
    padding: 15px 18px;
    background: transparent;
    box-shadow: none;
    font-size: 1.05rem;
    font-weight: 500;
}

.woo-wallet-withdrawal-panel .woo-wallet-form-wrapper .woo-wallet-currency-input-group input[type="number"]:focus {
    outline: none;
    background: transparent;
}

/* Override old float-based layout from legacy templates */
.wallet_withdraw_request .currency_input,
.woo-wallet-withdrawal-panel .currency_input {
    float: none;
    width: 100%;
}

.wallet_withdraw_request label {
    float: none;
    width: 100%;
    text-align: left;
    margin-bottom: 8px;
}

/* Notice container inside form */
#woo_wallet_withdrawal_notice:not(:empty) {
    margin-bottom: 20px;
}

#woo_wallet_withdrawal_notice .woocommerce-error,
#woo_wallet_withdrawal_notice .woocommerce-info {
    margin: 0 0 10px 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.92rem;
    border-left: 4px solid var(--wallet-primary-color);
    background: #eef0ff;
    color: #3530a8;
}

/* Submit row */
.woo-wallet-withdrawal-submit-row {
    margin-top: 8px;
    margin-bottom: 0;
}

.woo-wallet-withdrawal-panel .woo-wallet-form-wrapper input[type="submit"],
.woo-wallet-withdrawal-panel .woo-wallet-form-wrapper button[type="submit"] {
    display: inline-block;
    background: var(--wallet-primary-color, #483DE0) !important;
    color: #fff !important;
    border: 0 !important;
    padding: 14px 36px !important;
    border-radius: 8px !important;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
    cursor: pointer;
    min-width: 160px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.woo-wallet-withdrawal-panel .woo-wallet-form-wrapper input[type="submit"]:hover:not([disabled]) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(72, 61, 224, 0.22);
}

.woo-wallet-withdrawal-panel .woo-wallet-form-wrapper input[type="submit"][disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ── Withdrawal history ──────────────────────────────────────── */
.woo-wallet-withdrawal-history {
    margin-top: 34px;
}

.woo-wallet-withdrawal-history .woo-wallet-section-title {
    padding: 0 0 14px 0 !important;
    border-bottom: 0 !important;
}

.woo-wallet-withdrawal-notes-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #7f8c8d !important;
    background: #f3f4f8;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.woo-wallet-withdrawal-notes-link:hover {
    background: var(--wallet-primary-color);
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(72, 61, 224, 0.25);
}

.woo-wallet-withdrawal-notes-link .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
}

/* ── Status badges ───────────────────────────────────────────── */
.withdrawal-status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.withdrawal-status-badge.withdrawal-status-ww-pending {
    background: #fff7e0;
    color: #8a6100;
    border-color: #ffd966;
}

.withdrawal-status-badge.withdrawal-status-ww-approved {
    background: #e5f6ed;
    color: #1f7a4c;
    border-color: #8fd6b0;
}

.withdrawal-status-badge.withdrawal-status-ww-cancelled {
    background: #fdeaea;
    color: #9b1d1d;
    border-color: #f3a1a1;
}

/* ── Gateway settings field groups ───────────────────────────── */
.woo_wallet_payment_settings_fields_wrapper {
    display: none;
    margin-top: 8px;
    padding: 18px 20px;
    background: #fafbff;
    border: 1px dashed #d7dcff;
    border-radius: 10px;
    margin-bottom: 22px;
}

.woo-wallet-withdrawal-panel .woo-wallet-form-wrapper .woo_wallet_payment_settings_fields_wrapper input[type="text"],
.woo-wallet-withdrawal-panel .woo-wallet-form-wrapper .woo_wallet_payment_settings_fields_wrapper input[type="email"],
.woo-wallet-withdrawal-panel .woo-wallet-form-wrapper .woo_wallet_payment_settings_fields_wrapper input[type="number"],
.woo-wallet-withdrawal-panel .woo-wallet-form-wrapper .woo_wallet_payment_settings_fields_wrapper select {
    margin-bottom: 14px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .woo-wallet-withdrawal-panel .woo-wallet-withdrawal-inner {
        padding: 20px;
    }

    .woo-wallet-withdrawal-summary {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 20px;
    }

    .woo-wallet-withdrawal-summary__action {
        align-self: stretch;
        justify-content: center;
    }

    .woo-wallet-currency-input-group {
        flex-direction: row;
    }
}

/* =============================================================
   Thickbox modal — withdrawal notes (redesigned)
   Targets WordPress Thickbox when the notes AJAX is loaded.
   ============================================================= */

/* Hide unused Thickbox chrome */
body.modal-open #TB_title,
#TB_ajaxWindowTitle {
    display: none !important;
}

#TB_window:has(.woo-wallet-withdrawal-notes-modal),
#TB_window.woo-wallet-withdrawal-notes-tb {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28) !important;
    background: #fff !important;
    border: 0 !important;
}

#TB_ajaxContent:has(.woo-wallet-withdrawal-notes-modal) {
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box;
    background: #fff;
}

/* Modal shell */
.woo-wallet-withdrawal-notes-modal {
    --wallet-primary-color: #483DE0;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 80vh;
    overflow: hidden;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: #2c3e50;
}

.woo-wallet-withdrawal-notes-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(135deg, #483DE0 0%, #6A5CF0 100%);
    color: #fff;
}

.woo-wallet-withdrawal-notes-modal__header h1,
.woo-wallet-withdrawal-notes-modal__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #fff;
}

.woo-wallet-withdrawal-notes-modal__close {
    background: rgba(255, 255, 255, 0.18);
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    padding: 0;
}

.woo-wallet-withdrawal-notes-modal__close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.woo-wallet-withdrawal-notes-modal__close .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
}

.woo-wallet-withdrawal-notes-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px;
    background: #f8f9fc;
}

.woo-wallet-withdrawal-notes-modal__body ul.order_notes {
    list-style: none;
    margin: 0;
    padding: 0;
}

.woo-wallet-withdrawal-notes-modal__body ul.order_notes li {
    margin: 0 0 14px 0;
    padding: 0;
}

.woo-wallet-withdrawal-notes-modal__body ul.order_notes .no-items {
    text-align: center;
    padding: 40px 20px;
    color: #9ba3af;
    font-style: italic;
    background: transparent;
}

.woo-wallet-withdrawal-notes-modal__body ul.order_notes li .note_content {
    background: #fff;
    padding: 14px 16px;
    border-radius: 10px 10px 10px 2px;
    border: 1px solid #e7e9f1;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.woo-wallet-withdrawal-notes-modal__body ul.order_notes li.customer-note .note_content {
    background: #eef0ff;
    border-color: #d7dcff;
}

.woo-wallet-withdrawal-notes-modal__body ul.order_notes li .note_content::after {
    content: "";
    display: block;
    position: absolute;
    bottom: -8px;
    left: 14px;
    width: 0;
    height: 0;
    border-width: 8px 8px 0 0;
    border-style: solid;
    border-color: #fff transparent;
    filter: drop-shadow(0 1px 0 #e7e9f1);
}

.woo-wallet-withdrawal-notes-modal__body ul.order_notes li.customer-note .note_content::after {
    border-color: #eef0ff transparent;
    filter: drop-shadow(0 1px 0 #d7dcff);
}

.woo-wallet-withdrawal-notes-modal__body ul.order_notes li .note_content p {
    margin: 0;
    padding: 0;
    word-wrap: break-word;
    color: #2c3e50;
    font-size: 0.92rem;
    line-height: 1.5;
}

.woo-wallet-withdrawal-notes-modal__body ul.order_notes li p.meta {
    margin: 8px 0 0 4px;
    color: #9ba3af;
    font-size: 0.75rem;
    font-weight: 500;
}

.woo-wallet-withdrawal-notes-modal__body ul.order_notes li a.delete_note {
    display: none;
}

/* Footer with add note composer */
.woo-wallet-withdrawal-notes-modal__footer {
    flex: 0 0 auto;
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid #e7e9f1;
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.woo-wallet-withdrawal-notes-modal__footer input[type="text"] {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f9fafc;
    font-size: 0.92rem;
    color: #2c3e50;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    width: auto;
    margin: 0;
    box-sizing: border-box;
}

.woo-wallet-withdrawal-notes-modal__footer input[type="text"]:focus {
    border-color: var(--wallet-primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(72, 61, 224, 0.12);
}

.woo-wallet-withdrawal-notes-modal__footer .add_note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 22px;
    border: 0;
    border-radius: 8px;
    background: var(--wallet-primary-color);
    color: #fff !important;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    text-decoration: none !important;
    white-space: nowrap;
    line-height: 1;
}

.woo-wallet-withdrawal-notes-modal__footer .add_note:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(72, 61, 224, 0.25);
}

.woo-wallet-withdrawal-notes-modal__footer .add_note:active {
    transform: translateY(0);
}

.woo-wallet-withdrawal-notes-modal__footer .add_note .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 16px;
}

/* Responsive modal */
@media (max-width: 560px) {
    .woo-wallet-withdrawal-notes-modal__footer {
        flex-direction: column;
    }

    .woo-wallet-withdrawal-notes-modal__footer .add_note {
        justify-content: center;
    }
}
