/**
 * DEED Pay Admin Styles
 *
 * @package DEEDPay
 * @since   0.1.1
 */

/* =========================================================================
   Settings page - header
   ========================================================================= */

.deedpay-settings-wrap {
    max-width: 900px;
}

.deedpay-settings-header {
    background: #fff;
    border: 1px solid #dcdcde;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 16px 20px 12px;
    margin-bottom: 0;
}

.deedpay-settings-header h2 {
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.deedpay-settings-subtitle {
    color: #646970;
    margin: 4px 0 0;
    font-size: 13px;
}

/* =========================================================================
   Settings page - tab navigation
   ========================================================================= */

.deedpay-nav-tabs {
    margin-top: 0 !important;
    padding: 0 12px !important;
    background: #fff;
    border: 1px solid #dcdcde;
    border-top: none;
    border-bottom-color: #c3c4c7;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.deedpay-nav-tabs .nav-tab {
    margin: 0 6px -1px 0; /* fallback spacing if flex gap is ignored/overridden */
    font-size: 13px;
    padding: 8px 14px;
    margin-left: 0;
    float: none;
}

.deedpay-nav-tabs .nav-tab-active {
    background: #f0f0f1;
    border-bottom-color: #f0f0f1;
    color: #1d2327;
}

/* =========================================================================
   Settings page - tab panels
   ========================================================================= */

.deedpay-tab-panels {
    background: #fff;
    border: 1px solid #dcdcde;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 20px 24px;
}

.deedpay-tab-panel {
    display: none;
}

.deedpay-tab-panel--active {
    display: block;
}

/* =========================================================================
   Settings page - debug tab footer
   ========================================================================= */

.deedpay-debug-footer {
    border-top: 1px solid #dcdcde;
    padding-top: 16px;
    margin-top: 16px;
}

.deedpay-sysinfo td:first-child {
    font-weight: 600;
    width: 200px;
}

/* =========================================================================
   Mode indicators
   ========================================================================= */

.deedpay-test-mode-indicator,
.deedpay-live-mode-indicator {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.5;
}

.deedpay-test-mode-indicator {
    background: #f0a500;
    color: #fff;
}

.deedpay-live-mode-indicator {
    background: #00a32a;
    color: #fff;
}

/* =========================================================================
   Webhook URL display
   ========================================================================= */

.deedpay-webhook-url {
    background: #f9f9f9;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    display: inline-block;
    margin-top: 6px;
    word-break: break-all;
}

/* =========================================================================
   Status badges (meta box + order notes)
   ========================================================================= */

.deedpay-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.5;
}

.deedpay-status-pending,
.deedpay-status--- {
    background: #f0f0f1;
    color: #50575e;
}

.deedpay-status-paid,
.deedpay-status-escrowed,
.deedpay-status-processing {
    background: #c6e1c6;
    color: #0f5132;
}

.deedpay-status-shipped,
.deedpay-status-delivered {
    background: #b8daff;
    color: #004085;
}

.deedpay-status-completed {
    background: #00a32a;
    color: #fff;
}

.deedpay-status-failed,
.deedpay-status-cancelled,
.deedpay-status-expired {
    background: #f0f0f1;
    color: #50575e;
}

.deedpay-status-refunded {
    background: #fff3cd;
    color: #664d03;
}

.deedpay-status-disputed {
    background: #f8d7da;
    color: #842029;
}

/* =========================================================================
   Order meta box - layout
   ========================================================================= */

.deedpay-metabox {
    font-size: 13px;
}

.deedpay-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f1;
    gap: 8px;
}

.deedpay-meta-row:last-of-type {
    border-bottom: none;
}

.deedpay-meta-label {
    color: #646970;
    flex-shrink: 0;
    min-width: 72px;
    font-size: 12px;
}

.deedpay-meta-value {
    text-align: right;
    word-break: break-all;
}

.deedpay-meta-value code {
    font-size: 11px;
    background: #f6f7f7;
    padding: 2px 5px;
    border-radius: 2px;
}

.deedpay-meta-value a {
    text-decoration: none;
    color: #2271b1;
    font-size: 12px;
    margin-left: 3px;
}

.deedpay-meta-dispute .deedpay-meta-value {
    color: #842029;
}

.deedpay-meta-divider {
    border: none;
    border-top: 1px solid #dcdcde;
    margin: 10px 0;
}

/* =========================================================================
   Order meta box - action buttons
   ========================================================================= */

.deedpay-meta-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.deedpay-meta-actions .button {
    width: 100%;
    text-align: center;
    justify-content: center;
}

.deedpay-ship-form,
.deedpay-dispute-form {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.deedpay-ship-form input[type="text"],
.deedpay-dispute-form textarea {
    font-size: 12px !important;
    padding: 4px 6px !important;
    height: auto !important;
}

.deedpay-dispute-form textarea {
    resize: vertical;
    min-height: 52px;
}

/* =========================================================================
   Order meta box - AJAX feedback
   ========================================================================= */

.deedpay-meta-feedback {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 3px;
    font-size: 12px;
    line-height: 1.4;
}

.deedpay-meta-feedback.deedpay-feedback--success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.deedpay-meta-feedback.deedpay-feedback--error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

/* =========================================================================
   Responsive tweaks
   ========================================================================= */

@media screen and (max-width: 782px) {
    .deedpay-webhook-url {
        display: block;
        margin-top: 8px;
    }

    .deedpay-settings-header h2 {
        flex-wrap: wrap;
    }
}
