/* ==========================================================================
   PayStage Disputes — Shared CSS (front-end + admin)
   Version: 1.1.0
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. FRONT-END: Buyer Protection / Dispute Box
   -------------------------------------------------------------------------- */

.paystage-dispute-box {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 24px 0;
    background: #fafafa;
}

.paystage-dispute-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.paystage-dispute-header .paystage-dispute-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.paystage-dispute-header strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.paystage-dispute-header p {
    margin: 0;
    color: #555;
    font-size: 13px;
}

/* Open Dispute Button */
.paystage-open-dispute-btn {
    background: transparent !important;
    border: 1px solid #d63638 !important;
    color: #d63638 !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    padding: 6px 14px !important;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.paystage-open-dispute-btn:hover {
    background: #d63638 !important;
    color: #fff !important;
}

/* Dispute Form */
.paystage-dispute-form {
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
    margin-top: 4px;
}

.paystage-form-row {
    margin-bottom: 14px;
}

.paystage-form-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.paystage-form-row label .required {
    color: #d63638;
}

.paystage-reason-select,
.paystage-details-textarea {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 13px;
    box-sizing: border-box;
}

.paystage-details-textarea {
    resize: vertical;
    min-height: 72px;
}

.paystage-form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.paystage-submit-dispute {
    background: #d63638 !important;
    color: #fff !important;
    border-color: #d63638 !important;
}

.paystage-submit-dispute:hover {
    background: #b02a2c !important;
    border-color: #b02a2c !important;
}

.paystage-dispute-response {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
}

.paystage-dispute-response.success {
    background: #edfaef;
    border: 1px solid #7bc98c;
    color: #1a6e30;
}

.paystage-dispute-response.error {
    background: #fce8e8;
    border: 1px solid #e57373;
    color: #a61c1c;
}

/* Status notices */
.paystage-dispute-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 13px;
}

.paystage-dispute-notice .paystage-dispute-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.paystage-dispute-notice strong {
    display: block;
    margin-bottom: 4px;
}

.paystage-dispute-notice p {
    margin: 0;
}

.paystage-dispute-open {
    background: #fff8e5;
    border: 1px solid #f0c040;
    color: #6b4c00;
}

.paystage-dispute-resolved {
    background: #edfaef;
    border: 1px solid #7bc98c;
    color: #1a6e30;
}

/* --------------------------------------------------------------------------
   2. ADMIN: Disputes Dashboard
   -------------------------------------------------------------------------- */

.paystage-disputes-dashboard h1 {
    margin-bottom: 16px;
}

.paystage-dispute-count {
    color: #555;
    margin-bottom: 16px;
}

.paystage-disputes-table th,
.paystage-disputes-table td {
    vertical-align: middle;
    padding: 10px 12px;
}

.paystage-reason-badge {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #f0c040;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 12px;
    white-space: nowrap;
}

.paystage-details-preview {
    cursor: help;
    border-bottom: 1px dashed #aaa;
}

.paystage-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.paystage-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #ccc;
    display: block;
    margin: 0 auto 12px;
}

/* --------------------------------------------------------------------------
   3. ADMIN: Resolution Modal
   -------------------------------------------------------------------------- */

.paystage-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 100000;
}

.paystage-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    padding: 28px 32px;
    width: 480px;
    max-width: 95vw;
    z-index: 100001;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.paystage-modal h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.paystage-modal-order-info {
    color: #555;
    font-size: 13px;
    margin-bottom: 20px;
}

.paystage-resolution-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.paystage-resolution-option {
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.paystage-resolution-option:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.paystage-resolution-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.paystage-resolution-option.selected {
    border-color: #2271b1;
    background: #f0f6fc;
}

.paystage-resolution-option span {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.paystage-resolution-option small {
    font-size: 12px;
    color: #666;
}

#paystage-split-amount {
    margin-bottom: 20px;
}

#paystage-split-amount label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

#paystage_refund_amount {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.paystage-modal-actions {
    display: flex;
    gap: 10px;
}

.paystage-resolve-message {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
}

.paystage-resolve-message.success {
    background: #edfaef;
    border: 1px solid #7bc98c;
    color: #1a6e30;
}

.paystage-resolve-message.error {
    background: #fce8e8;
    border: 1px solid #e57373;
    color: #a61c1c;
}

/* --------------------------------------------------------------------------
   PayStage main admin (WooCommerce > PayStage) — stat cards / dashboard
   -------------------------------------------------------------------------- */

.paystage-admin-wrap .paystage-stat-cards {
    align-items: stretch;
}

.paystage-admin-wrap .paystage-stat-card {
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Front-end: Confirm delivery box (enhanced)
   -------------------------------------------------------------------------- */

.paystage-confirm-box--enhanced {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 24px 0;
    max-width: 640px;
}

.paystage-confirm-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.paystage-confirm-shield {
    flex-shrink: 0;
    line-height: 0;
}

.paystage-confirm-title {
    margin: 0;
    font-size: 1.1rem;
    color: #2271b1;
}

.paystage-confirm-lead,
.paystage-confirm-autorelease {
    margin: 0 0 12px;
    color: #444;
    font-size: 14px;
    line-height: 1.5;
}

.paystage-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.paystage-confirm-actions .button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.paystage-confirm-open-dispute {
    background: #fff !important;
    border: 1px solid #d63638 !important;
    color: #d63638 !important;
}

.paystage-confirm-open-dispute:hover {
    background: #fcf0f1 !important;
    color: #a00 !important;
}

.paystage-confirm-msg {
    margin-top: 12px;
    font-size: 14px;
}

.paystage-confirm-success {
    display: none;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 14px;
    background: #edfaef;
    border: 1px solid #7bc98c;
    border-radius: 6px;
    color: #1a6e30;
}

.paystage-confirm-success-icon {
    font-size: 20px;
    font-weight: bold;
    line-height: 1.2;
}

.paystage-confirm-success-text {
    margin: 0;
    font-size: 14px;
}

@media (max-width: 600px) {
    .paystage-confirm-actions {
        flex-direction: column;
        align-items: stretch;
    }

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

/* --------------------------------------------------------------------------
   Admin: Disputes dashboard — summary, reason badges, empty state
   -------------------------------------------------------------------------- */

.paystage-dispute-summary-bar {
    font-size: 14px;
}

.paystage-empty-state-enhanced .paystage-empty-title {
    margin: 8px 0 4px;
    font-size: 18px;
    color: #1d2327;
}

.paystage-empty-state-enhanced .paystage-empty-sub {
    margin: 0;
    color: #646970;
    font-size: 14px;
}

.paystage-empty-state-enhanced .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #c3c4c7;
}

.paystage-reason-badge--not_received {
    background: #e7f5ff;
    color: #135e96;
    border-color: #72aee6;
}

.paystage-reason-badge--not_as_described {
    background: #fff8e5;
    color: #996800;
    border-color: #f0c040;
}

.paystage-reason-badge--damaged {
    background: #fcf0f1;
    color: #8a2424;
    border-color: #e89393;
}

.paystage-reason-badge--wrong_item {
    background: #f0f6fc;
    color: #1d2327;
    border-color: #c3c4c7;
}

.paystage-reason-badge--other {
    background: #f6f7f7;
    color: #50575e;
    border-color: #dcdcde;
}

.paystage-modal-summary {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
}

.paystage-modal-summary p {
    margin: 0 0 6px;
}

.paystage-modal-summary p:last-child {
    margin-bottom: 0;
}

.paystage-resolution-option.selected {
    border-color: #2271b1 !important;
    background: #f0f6fc !important;
    box-shadow: 0 0 0 1px #2271b1;
}

.paystage-vendor-receives {
    font-size: 13px;
}

#paystage-confirm-resolve:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
