/* Enhanced Refund System CSS */
/* Refund Status Styles */
.refund-status-container {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 5px;
}

.refund-status-pending {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.refund-status-approved {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.refund-status-processing {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.refund-status-completed {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.refund-status-rejected {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.refund-status-none {
    color: #6c757d;
    font-style: italic;
}

.refund-amount {
    font-weight: bold;
    color: #007cba;
    margin: 5px 0;
}

.refund-actions {
    margin-top: 5px;
}

.view-refund-details {
    font-size: 0.85em;
    color: #007cba;
    text-decoration: none;
}

.view-refund-details:hover {
    text-decoration: underline;
}

/* Order Actions Button Styles */
.button.refund-request-btn {
    background-color: #007cba;
    color: white;
    border-color: #007cba;
}

.button.view-refund-status-btn {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}

.button.refund-status-pending {
    background-color: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

.button.refund-status-approved {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}

.button.refund-status-processing {
    background-color: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.button.refund-status-completed {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}

.button.refund-status-rejected {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

.button.refund-disabled-btn {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.button.refund-disabled-btn:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.button.refund-disabled-btn:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    margin-bottom: -5px;
    z-index: 1000;
}

/* Refund Details Page */
.refund-details-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.refund-status-badge-large {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 20px;
}

.refund-details-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.refund-details-table th,
.refund-details-table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.refund-details-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.refund-details-table tr:last-child td {
    border-bottom: none;
}

.refund-timeline {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.timeline-item {
    display: flex;
    margin-bottom: 15px;
    position: relative;
}

.timeline-date {
    width: 120px;
    color: #6c757d;
    font-size: 0.9em;
}

.timeline-content {
    flex: 1;
    padding-left: 20px;
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #007cba;
}
.custom-tooltip {
    position: absolute;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 9999;
    max-width: 300px;
    white-space: normal;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.custom-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}
/* Order Summary Card */
.order-summary-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.order-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.info-item strong {
    color: #495057;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.breakdown-section {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.breakdown-table {
    width: 100%;
    border-collapse: collapse;
}

.breakdown-table tr td {
    padding: 8px 0;
    border-bottom: 1px solid #f1f1f1;
}

.breakdown-table .total-row td {
    border-top: 2px solid #dee2e6;
    font-weight: bold;
    padding-top: 12px;
}

.breakdown-table .available-row td {
    color: #28a745;
    font-size: 1.1em;
}

/* Clawback Notice */
.clawback-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #f39c12;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 4px;
}

.clawback-notice h4 {
    color: #856404;
    margin-top: 0;
}

.clawback-notice ul {
    margin: 10px 0 0 20px;
}

/* Form Sections */
.form-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-section h3 {
    margin-top: 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
    color: #343a40;
}

.refund-items-selection {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    background: #f8f9fa;
}

.refund-item-checkbox {
    padding: 8px;
    border-bottom: 1px solid #e9ecef;
}

.refund-item-checkbox:last-child {
    border-bottom: none;
}

.refund-item-checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.refund-item-checkbox input[type="checkbox"] {
    margin-right: 10px;
}

/* Amount Input with Slider */
.amount-input-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.currency-symbol {
    background: #e9ecef;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-weight: bold;
}

.refund-amount-input {
    flex: 1;
    border: 1px solid #ced4da;
    border-radius: 0 4px 4px 0;
    padding: 10px;
    font-size: 1.1em;
}

.amount-slider {
    margin-top: 15px;
}

.amount-slider input[type="range"] {
    width: 100%;
    height: 6px;
    background: #dee2e6;
    border-radius: 3px;
    outline: none;
}

.amount-slider input[type="range"]::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    background: #007cba;
    border-radius: 50%;
    cursor: pointer;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    color: #6c757d;
    font-size: 0.9em;
}

/* Refund Summary Card */
.refund-summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.refund-summary-card h3 {
    color: white;
    margin-top: 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 15px;
}

.summary-details {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.summary-row.total {
    border-top: 2px solid rgba(255,255,255,0.3);
    border-bottom: none;
    font-size: 1.2em;
    margin-top: 10px;
    padding-top: 15px;
}

/* Timeline */
.summary-timeline {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.timeline-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.timeline-step {
    text-align: center;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    position: relative;
}

.timeline-step.active {
    background: rgba(255,255,255,0.2);
    border: 2px solid #fff;
}

.step-number {
    display: block;
    width: 30px;
    height: 30px;
    background: white;
    color: #764ba2;
    border-radius: 50%;
    line-height: 30px;
    margin: 0 auto 10px;
    font-weight: bold;
}

.step-label {
    display: block;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.step-time {
    display: block;
    font-size: 0.8em;
    opacity: 0.8;
}

/* Terms Section */
.terms-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.terms-checkbox {
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex !important;
    align-items: flex-start;
    cursor: pointer;
    position: relative;
    padding-left: 35px;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 25px;
    width: 25px;
    background-color: #fff;
    border: 2px solid #ced4da;
    border-radius: 4px;
}

.checkbox-label:hover input ~ .checkmark {
    background-color: #f8f9fa;
}

.checkbox-label input:checked ~ .checkmark {
    background-color: #007cba;
    border-color: #007cba;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
    left: 9px;
    top: 5px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.terms-list {
    margin: 10px 0 0 30px;
    list-style-type: disc;
    color: #6c757d;
}

.terms-list li {
    margin-bottom: 5px;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.button-secondary {
    background: #6c757d;
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
}

/* Modal */
.refund-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 80%;
    max-width: 500px;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #6c757d;
}

.close-modal:hover {
    color: #343a40;
}

/* Status Badges */
.refund-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-processing {
    background: #d1ecf1;
    color: #0c5460;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

/* Risk Indicator */
.risk-score-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.risk-bar {
    flex: 1;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.risk-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.risk-fill[data-score^="0"],
.risk-fill[data-score^="1"],
.risk-fill[data-score^="2"],
.risk-fill[data-score^="3"] {
    background: #28a745;
}

.risk-fill[data-score^="4"],
.risk-fill[data-score^="5"] {
    background: #ffc107;
}

.risk-fill[data-score^="6"],
.risk-fill[data-score^="7"] {
    background: #fd7e14;
}

.risk-fill[data-score^="8"],
.risk-fill[data-score^="9"],
.risk-fill[data-score="100"] {
    background: #dc3545;
}

.risk-value {
    min-width: 40px;
    text-align: right;
    font-weight: 600;
}

/* Admin Dashboard Styles */
.refund-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
}

.stat-card h3 {
    margin: 0 0 10px;
    font-size: 2em;
    color: #007cba;
}

.stat-card p {
    margin: 0;
    color: #6c757d;
}

.stat-trend {
    display: inline-block;
    margin-top: 10px;
    padding: 2px 8px;
    background: #d4edda;
    color: #155724;
    border-radius: 12px;
    font-size: 0.8em;
}

.refund-charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.fraud-detection-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.fraud-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.patterns-list, .flags-list {
    max-height: 300px;
    overflow-y: auto;
}

.pattern-item, .flag-item {
    padding: 10px;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flag-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.flag-tag {
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    color: #6c757d;
}

/* Export Section */
.export-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
}

.export-options {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.export-date-range {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.export-date-range input[type="date"] {
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.export-format {
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .order-info-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline-steps {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .refund-charts-section {
        grid-template-columns: 1fr;
    }
    
    .fraud-stats {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.refund-summary-card {
    animation: slideIn 0.5s ease-out;
}

/* Loading States */
.btn-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.submit-refund-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}