/**
 * TUI退款系统前端样式
 * 
 * @package TUI_Refund_System
 */

/* ========================================
   退款申请表单样式
======================================== */
.tui-refund-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tui-refund-form-container h3 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.tui-refund-form .form-row {
    margin-bottom: 20px;
}

.tui-refund-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.tui-refund-form .required {
    color: #d63638;
}

.tui-refund-form input[type="text"],
.tui-refund-form input[type="number"],
.tui-refund-form input[type="email"],
.tui-refund-form select,
.tui-refund-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.tui-refund-form input:focus,
.tui-refund-form select:focus,
.tui-refund-form textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 5px rgba(0,115,170,0.3);
}

.tui-refund-form .refund-type-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.tui-refund-form .radio-label,
.tui-refund-form .checkbox-label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    margin-bottom: 0;
}

.tui-refund-form .radio-label input,
.tui-refund-form .checkbox-label input {
    width: auto;
    margin-right: 8px;
}

/* 金额输入样式 */
.amount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 12px;
    color: #666;
    font-weight: bold;
    z-index: 2;
}

.amount-input-wrapper input {
    padding-left: 35px;
}

.amount-info {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* 订单详情样式 */
.order-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
}

.order-details-table {
    width: 100%;
    border-collapse: collapse;
}

.order-details-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

.order-details-table td:first-child {
    font-weight: bold;
    width: 30%;
    color: #666;
}

.refundable-amount {
    color: #00a32a;
    font-weight: bold;
}

/* 表单操作按钮 */
.form-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.tui-refund-submit {
    background: #0073aa;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.tui-refund-submit:hover {
    background: #005a87;
}

.tui-refund-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.form-actions .loading {
    margin-top: 10px;
    color: #666;
}

/* ========================================
   退款历史记录样式
======================================== */
.tui-refund-history-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.refund-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0073aa;
}

.refund-history-header h3 {
    margin: 0;
    color: #333;
}

.no-refunds-message {
    text-align: center;
    padding: 50px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

/* 退款申请表格 */
.refund-requests-table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tui-refund-requests-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.tui-refund-requests-table th,
.tui-refund-requests-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.tui-refund-requests-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.tui-refund-requests-table tr:hover {
    background: #f8f9fa;
}

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-badge.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-approved {
    background: #d1ecf1;
    color: #0c5460;
}

.status-badge.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-cancelled {
    background: #e2e3e5;
    color: #383d41;
}

/* 退款详情 */
.refund-details-row {
    background: #f8f9fa !important;
}

.refund-details {
    padding: 20px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.detail-item label {
    font-weight: bold;
    color: #666;
    margin-bottom: 5px;
}

.detail-item p {
    margin: 0;
    color: #333;
}

.attachments .attachment-link {
    display: inline-block;
    margin-right: 10px;
    padding: 5px 10px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
}

.attachments .attachment-link:hover {
    background: #005a87;
}

/* 状态历史时间线 */
.status-history h4 {
    margin-bottom: 15px;
    color: #333;
}

.status-timeline {
    position: relative;
    padding-left: 30px;
}

.status-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ddd;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #eee;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 20px;
    width: 12px;
    height: 12px;
    background: #0073aa;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #0073aa;
}

.timeline-item.status-approved::before {
    background: #00a32a;
    box-shadow: 0 0 0 2px #00a32a;
}

.timeline-item.status-rejected::before {
    background: #d63638;
    box-shadow: 0 0 0 2px #d63638;
}

.timeline-item.status-completed::before {
    background: #00a32a;
    box-shadow: 0 0 0 2px #00a32a;
}

.timeline-status {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.timeline-date {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.timeline-user {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.timeline-notes {
    color: #333;
    font-style: italic;
}

/* ========================================
   模态对话框样式
======================================== */
.tui-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h4 {
    margin: 0;
    color: #333;
}

.modal-header .close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.modal-header .close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-actions .button.secondary {
    background: #646970;
    color: white;
}

.modal-actions .button.secondary:hover {
    background: #50575e;
}

/* ========================================
   订单页面退款按钮样式
======================================== */
.tui-refund-button-wrap {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.tui-refund-button {
    background: #0073aa;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.tui-refund-button:hover {
    background: #005a87;
    color: white;
}

.tui-refund-notice {
    padding: 10px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    margin: 15px 0;
}

/* ========================================
   响应式设计
======================================== */
@media (max-width: 768px) {
    .tui-refund-form-container,
    .tui-refund-history-container {
        padding: 15px;
        margin: 10px;
    }
    
    .refund-history-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .refund-type-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .tui-refund-requests-table {
        font-size: 14px;
    }
    
    .tui-refund-requests-table th,
    .tui-refund-requests-table td {
        padding: 8px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .tui-refund-form-container h3 {
        font-size: 18px;
    }
    
    .tui-refund-submit {
        width: 100%;
        padding: 15px;
    }
    
    .status-timeline {
        padding-left: 20px;
    }
    
    .timeline-item::before {
        left: -15px;
    }
}

/* ========================================
   加载动画
======================================== */
.tui-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,115,170,.3);
    border-radius: 50%;
    border-top-color: #0073aa;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   成功/错误消息样式
======================================== */
.tui-message {
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
    border-left: 4px solid;
}

.tui-message.success {
    background: #d4edda;
    color: #155724;
    border-color: #00a32a;
}

.tui-message.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #d63638;
}

.tui-message.warning {
    background: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

.tui-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #17a2b8;
}

/* ========================================
   表单验证样式
======================================== */
.form-row.error input,
.form-row.error select,
.form-row.error textarea {
    border-color: #d63638;
    box-shadow: 0 0 5px rgba(214,54,56,0.3);
}

.form-row .error-message {
    color: #d63638;
    font-size: 12px;
    margin-top: 5px;
}

/* ========================================
   工具提示样式
======================================== */
.tui-tooltip {
    position: relative;
    display: inline-block;
}

.tui-tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tui-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tui-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
} 