/**
 * Whalet Payment 退款功能样式
 *
 * 退款模态框和相关组件的样式定义
 */

/* 防止背景滚动 */
body.whalet-modal-open {
    overflow: hidden;
}

/* 模态框遮罩层 */
.whalet-refund-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.whalet-refund-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 模态框主体 */
.whalet-refund-modal {
    background: var(--whalet-bg, #ffffff);
    border-radius: var(--whalet-radius, 12px);
    box-shadow: 0 20px 60px rgba(125, 51, 255, 0.15), 0 8px 30px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.whalet-refund-modal.show {
    transform: scale(1) translateY(0);
}

/* 模态框头部 */
.whalet-refund-modal-header {
    background: linear-gradient(135deg, var(--whalet-primary, #7d33ff), var(--whalet-primary-light, #9554ff));
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.whalet-refund-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.15"/><circle cx="10" cy="60" r="0.5" fill="%23ffffff" opacity="0.15"/><circle cx="90" cy="40" r="0.5" fill="%23ffffff" opacity="0.15"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
}

.whalet-refund-modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.whalet-refund-modal-title .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.whalet-refund-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.whalet-refund-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.whalet-refund-modal-close .dashicons {
    color: white;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* 模态框主体内容 */
.whalet-refund-modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* 订单信息 */
.whalet-refund-order-info {
    background: var(--whalet-bg-light, #fafbfc);
    border: 1px solid var(--whalet-border-light, #f1f3f4);
    border-radius: var(--whalet-radius-sm, 8px);
    padding: 16px;
    margin-bottom: 12px;
    display: grid;
    gap: 16px;
}

.order-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-info-item label {
    font-size: 13px;
    font-weight: 500;
    color: var(--whalet-text-light, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-info-item .order-id {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--whalet-text, #2c3e50);
    background: var(--whalet-bg, #ffffff);
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid var(--whalet-border, #e9ecef);
}

.order-info-item .order-amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--whalet-primary, #7d33ff);
}

/* 退款表单 */
.whalet-refund-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.whalet-refund-form h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--whalet-text, #2c3e50);
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.whalet-refund-form .optional {
    font-size: 12px;
    font-weight: 400;
    color: var(--whalet-text-muted, #95a5a6);
}

/* 退款类型选项 */
.refund-type-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.refund-type-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--whalet-bg, #ffffff);
    border: 2px solid var(--whalet-border, #e9ecef);
    border-radius: var(--whalet-radius-sm, 8px);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.refund-type-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(125, 51, 255, 0.05), transparent);
    transition: left 0.5s ease;
}

.refund-type-option:hover {
    border-color: var(--whalet-primary, #7d33ff);
    background: rgba(125, 51, 255, 0.02);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(125, 51, 255, 0.1);
}

.refund-type-option:hover::before {
    left: 100%;
}

.refund-type-option input[type="radio"] {
    display: none;
}

.refund-type-option input[type="radio"]:checked + .radio-custom {
    background: var(--whalet-primary, #7d33ff);
    border-color: var(--whalet-primary, #7d33ff);
}

.refund-type-option input[type="radio"]:checked + .radio-custom::after {
    opacity: 1;
    transform: scale(1);
}

.refund-type-option input[type="radio"]:checked ~ .option-text strong {
    color: var(--whalet-primary, #7d33ff);
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--whalet-border, #e9ecef);
    border-radius: 50%;
    background: var(--whalet-bg, #ffffff);
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radio-custom::after {
    content: ' ';
    height: 8px;
    width: 8px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: all 0.2s ease;
}

.option-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-text strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--whalet-text, #2c3e50);
    transition: color 0.2s ease;
}

.option-text small {
    font-size: 12px;
    color: var(--whalet-text-light, #6c757d);
    line-height: 1.4;
}

/* 部分退款金额输入 */
.amount-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.amount-input-group input,
.refund-reason-section select {
    width: 100%;
    padding: 12px 16px;
    padding-right: 60px;
    border: 2px solid var(--whalet-border, #e9ecef);
    border-radius: var(--whalet-radius-sm, 8px);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: var(--whalet-bg, #ffffff);
}

.refund-reason-section select {

}

.amount-input-group input:focus {
    outline: none;
    border-color: var(--whalet-primary, #7d33ff);
    box-shadow: 0 0 0 3px rgba(125, 51, 255, 0.1);
}

.amount-input-group input.invalid,
.refund-reason-section select.invalid {
    border-color: var(--whalet-danger, #dc3545);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.currency-suffix {
    position: absolute;
    right: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--whalet-text-light, #6c757d);
    pointer-events: none;
}

/* 金额验证消息 */
.amount-validation-message,
.reason-validation-message {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
    min-height: 18px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.amount-validation-message.error,
.reason-validation-message.error {
    color: var(--whalet-danger, #dc3545);
}

.amount-validation-message.success {
    color: var(--whalet-success, #28a745);
}

.amount-validation-message::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
}

.amount-tips {
    margin-top: 8px;
}

.amount-tips small {
    color: var(--whalet-text-muted, #95a5a6);
    font-size: 12px;
}

/* 退款原因输入 */
.refund-reason-section textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--whalet-border, #e9ecef);
    border-radius: var(--whalet-radius-sm, 8px);
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 80px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.refund-reason-section textarea:focus {
    outline: none;
    border-color: var(--whalet-primary, #7d33ff);
    box-shadow: 0 0 0 3px rgba(125, 51, 255, 0.1);
}

.refund-reason-section textarea::placeholder {
    color: var(--whalet-text-muted, #95a5a6);
}

/* 模态框底部 */
.whalet-refund-modal-footer {
    background: var(--whalet-bg-light, #fafbfc);
    border-top: 1px solid var(--whalet-border-light, #f1f3f4);
    padding: 20px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.whalet-refund-modal-footer .whalet-btn {
    padding: 10px 20px;
    border-radius: var(--whalet-radius-sm, 8px);
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.whalet-btn-secondary {
    background: var(--whalet-bg, #ffffff);
    color: var(--whalet-text, #2c3e50);
    border: 2px solid var(--whalet-border, #e9ecef) !important;
}

.whalet-btn-secondary:hover {
    background: var(--whalet-bg-light, #fafbfc);
    border-color: var(--whalet-primary, #7d33ff) !important;
    color: var(--whalet-primary, #7d33ff);
    transform: translateY(-1px);
}

.whalet-btn-warning {
    background: linear-gradient(135deg, #ff9500, #ff7b00);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.3);
}

.whalet-btn-warning:hover {
    background: linear-gradient(135deg, #ff7b00, #ff6600);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.4);
    transform: translateY(-1px);
    color: white;
}

.whalet-btn-warning:disabled {
    background: var(--whalet-text-muted, #95a5a6);
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}

.whalet-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* 消息提示 */
.whalet-refund-message {
    padding: 12px 16px;
    border-radius: var(--whalet-radius-sm, 8px);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    animation: slideInDown 0.3s ease;
}

.whalet-refund-message-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--whalet-success, #28a745);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.whalet-refund-message-error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--whalet-danger, #dc3545);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.whalet-refund-message .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* 动画效果 */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .whalet-refund-modal {
        width: 95%;
        max-height: 95vh;
        margin: 20px;
    }

    .whalet-refund-modal-header {
        padding: 16px 20px;
        flex-shrink: 0;
    }

    .whalet-refund-modal-title {
        font-size: 16px;
    }

    .whalet-refund-modal-body {
        padding: 20px;
        max-height: calc(95vh - 140px);
        overflow-y: auto;
    }

    .whalet-refund-order-info {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .whalet-refund-modal-footer {
        padding: 16px 20px;
        flex-direction: column;
        flex-shrink: 0;
    }

    .whalet-refund-modal-footer .whalet-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .whalet-refund-modal {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .whalet-refund-modal-header {
        padding: 16px 20px;
        flex-shrink: 0;
    }

    .whalet-refund-modal-body {
        padding: 16px 20px;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .whalet-refund-modal-footer {
        padding: 16px 20px;
        flex-shrink: 0;
        background: var(--whalet-bg-light, #fafbfc);
        border-top: 1px solid var(--whalet-border-light, #f1f3f4);
        position: sticky;
        bottom: 0;
        z-index: 10;
    }

    .whalet-refund-modal-footer .whalet-btn {
        padding: 12px 20px;
        font-size: 16px;
    }
}
