/* ===== Form & Buttons ===== */
#jtee-return-form-container table {
    border-collapse: collapse;
    width: 100%;
}

.return-item-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 4px;
}

#jtee-return-form button {
    background: #0073aa;
    color: #fff;
    padding: 10px 16px;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

#jtee-return-form button:hover {
    opacity: 0.95;
}

/* ===== Meta & Thank You Page ===== */
.jtee-order-meta {
    font-size: 14px;
}

.jtee-thankyou-wrap img {
    max-width: 140px;
    max-height: 140px;
    object-fit: cover;
    border-radius: 6px;
}

/* ===== Table Responsive Wrapper ===== */
.jtee-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 15px;
}

/* Table inside the scroll wrapper */
.jtee-return-table {
    width: 100%;
    min-width: 650px; /* prevents cut-off columns */
    border-collapse: collapse;
    border: 1px solid #ddd;
    font-family: Arial, sans-serif;
}

/* Table headers */
.jtee-return-table th {
    background: #f5f5f5;
    text-align: left;
    padding: 10px;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
}

/* Table cells */
.jtee-return-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

/* Images inside table */
.jtee-return-table img {
    border-radius: 4px;
    object-fit: cover;
}

/* Checkbox & quantity inputs */
.return-item-checkbox,
.return-item-quantity {
    cursor: pointer;
}

/* Total display */
#jtee-total-selected {
    text-align: right;
    font-weight: bold;
    margin-top: 10px;
}

/* File upload warnings */
#jtee-file-type-warning,
#jtee-file-count-warning {
    background: #ffebee;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 4px solid #d32f2f;
    margin-top: 10px;
}

/* File upload info box */
#jtee-return-form-container div[style*="background: #f8f9fa"] {
    border: 1px solid #e0e0e0;
}

/* ===== Mobile Adjustments ===== */
@media (max-width: 600px) {
    .jtee-return-table th,
    .jtee-return-table td {
        padding: 6px 4px;
        font-size: 13px;
        white-space: nowrap;
    }

    .return-item-label {
        flex-direction: column;
        align-items: flex-start;
    }

    .return-item-label img {
        margin-bottom: 4px;
    }
    
    #jtee-file-type-warning,
    #jtee-file-count-warning {
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* ===== Admin Status Indicators (admin only) ===== */

/* Custom plugin table */
.wp-admin .status-return-requested {
    color: #f39c12;
    font-weight: bold;
}
.wp-admin .status-return-approved {
    color: #27ae60;
    font-weight: bold;
}
.wp-admin .status-return-not-approved {
    color: #e74c3c;
    font-weight: bold;
}
.wp-admin .status-return-authorized {
    color: #0073aa !important;
    font-weight: bold;
}
.wp-admin .status-return-request-declined {
    color: #d63638 !important;
    font-weight: bold;
}
.wp-admin .status-return-under-inspection {
    color: #f39c12 !important;
    font-weight: bold;
}

/* WooCommerce orders list in admin */
.wp-admin .order-status.status-return-requested {
    color: #f39c12 !important;
    font-weight: bold;
}
.wp-admin .order-status.status-return-approved {
    color: #27ae60 !important;
    font-weight: bold;
}
.wp-admin .order-status.status-return-not-approved {
    color: #e74c3c !important;
    font-weight: bold;
}
.wp-admin .order-status.status-return-authorized {
    color: #0073aa !important;
    font-weight: bold;
}
.wp-admin .order-status.status-return-request-declined {
    color: #d63638 !important;
    font-weight: bold;
}
.wp-admin .order-status.status-return-under-inspection {
    color: #f39c12 !important;
    font-weight: bold;
}
/* ===== Action Links ===== */
.widefat a {
    text-decoration: none;
}

.widefat a:hover {
    text-decoration: underline;
}

/* ===== Admin Notification Bubble ===== */
.awaiting-mod {
    display: inline-block;
    vertical-align: top;
    margin: 1px 0 0 2px;
    padding: 0 5px;
    min-width: 7px;
    height: 17px;
    border-radius: 11px;
    background-color: #d63638;
    color: #fff;
    font-size: 9px;
    line-height: 17px;
    text-align: center;
    z-index: 26;
}

.pending-count {
    display: block;
    font-weight: bold;
}

/* Make sure the bubble appears properly in the admin menu */
#adminmenu .awaiting-mod {
    float: right;
    margin: 6px 0 0 0;
}

#adminmenu li.current .awaiting-mod,
#adminmenu li.wp-has-current-submenu .awaiting-mod {
    background-color: #fff;
    color: #d63638;
}

/* Admin setting tabs
.jtee-tab-content {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-top: none;
    padding: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

/* Shake animation for invalid fields */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Bulk actions styling */
.jtee-bulk-actions {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.jtee-bulk-actions h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.jtee-bulk-actions button {
    transition: all 0.3s ease;
}

.jtee-bulk-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Expired reason styling */
.jtee-reason-expired {
    color: #dc3545 !important;
    text-decoration: line-through;
    opacity: 0.7;
}

.jtee-reason-expired option {
    color: #dc3545;
}

/* Validation error styling */
.jtee-validation-error {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* Business-friendly tooltips */
.jtee-business-tip {
    background: #e8f4fc;
    border-left: 4px solid #0073aa;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.jtee-business-tip h5 {
    margin: 0 0 10px 0;
    color: #0073aa;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jtee-business-tip ul {
    margin: 10px 0 0 20px;
    color: #666;
}

.jtee-business-tip li {
    margin-bottom: 5px;
}

/* ===== Specific Time Limit Rules Table ===== */
.jtee-exception-table-wrapper {
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.jtee-exception-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.jtee-exception-table thead th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    color: #2c3e50;
}

.jtee-exception-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.jtee-exception-table tbody tr:hover {
    background: #f9f9f9;
}

.jtee-exception-table td {
    padding: 15px;
    vertical-align: middle;
}

.jtee-exception-table .check-column {
    width: 40px;
    padding-left: 20px;
}

.jtee-exception-table .reason-column {
    min-width: 200px;
}

.jtee-exception-table .days-column {
    width: 150px;
}

.jtee-exception-table .preview-column {
    min-width: 250px;
}

.jtee-exception-table .actions-column {
    width: 100px;
    text-align: center;
}

.jtee-exception-table input[type="number"] {
    width: 100px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.jtee-exception-table select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.jtee-exception-table .preview-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.jtee-preview-unlimited {
    background: #e8f5e9;
    color: #2e7d32;
}

.jtee-preview-extended {
    background: #fff3e0;
    color: #ef6c00;
}

.jtee-preview-shorter {
    background: #ffebee;
    color: #c62828;
}

.jtee-preview-standard {
    background: #e3f2fd;
    color: #1565c0;
}

.jtee-preview-disabled {
    background: #f5f5f5;
    color: #757575;
    text-decoration: line-through;
}

/* Bulk Actions */
.jtee-bulk-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
}

.jtee-bulk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.jtee-bulk-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.jtee-bulk-actions .button {
    display: flex;
    align-items: center;
    gap: 5px;
}

.jtee-bulk-actions .button-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.jtee-bulk-actions .button-danger:hover {
    background: #dc3545;
    color: white;
}

/* Empty state */
.jtee-empty-table {
    text-align: center;
    padding: 40px 20px;
    background: #fafafa;
}

.jtee-empty-table-icon {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 15px;
}

/* Status indicators */
.jtee-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

.jtee-status-active {
    background: #d4edda;
    color: #155724;
}

.jtee-status-expired {
    background: #f8d7da;
    color: #721c24;
}

.jtee-status-unlimited {
    background: #d1ecf1;
    color: #0c5460;
}

/* Responsive table */
@media (max-width: 782px) {
    .jtee-exception-table-wrapper {
        overflow-x: auto;
    }
    
    .jtee-exception-table {
        min-width: 700px;
    }
}

/* ===== Admin Modal Styles ===== */
.jtee-details-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.jtee-details-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 900px;
    border-radius: 5px;
    max-height: 80vh;
    overflow-y: auto;
}

.jtee-details-content h3 {
    margin-top: 0;
    color: #333;
}

.jtee-details-content .close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.jtee-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.jtee-attachments img {
    max-width: 200px;
    max-height: 200px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    object-fit: cover;
}

.jtee-additional-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
    border-left: 4px solid #0073aa;
}

.jtee-delete-link {
    color: #a00 !important;
}

.jtee-delete-link:hover {
    color: #dc3232 !important;
}

.jtee-confirm-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.jtee-confirm-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 400px;
    border-radius: 5px;
    text-align: center;
}

.jtee-confirm-buttons {
    margin-top: 20px;
}

.jtee-confirm-buttons .button {
    margin: 0 5px;
}

.jtee-confirm-buttons .button-primary {
    background: #d63638 !important;
    border-color: #d63638 !important;
}

/* ===== Approval Modal Styles ===== */
.jtee-approve-modal {
    display: none;
    position: fixed;
    z-index: 1003;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.jtee-approve-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    max-height: 85vh;
    overflow-y: auto;
}

.jtee-approve-content h3 {
    margin-top: 0;
    color: #333;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.jtee-approve-close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    margin-top: -10px;
}

.jtee-approve-close:hover {
    color: #000;
}

.jtee-approve-form-group {
    margin-bottom: 20px;
}

.jtee-approve-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.jtee-approve-form-group select,
.jtee-approve-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.jtee-approve-form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.jtee-approve-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.jtee-approve-info {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

.jtee-approve-count {
    background: #e3f2fd;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 600;
}

/* ===== Rejection Modal Styles ===== */
.jtee-reject-modal {
    display: none;
    position: fixed;
    z-index: 1002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.jtee-reject-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    max-height: 85vh;
    overflow-y: auto;
}

.jtee-reject-content h3 {
    margin-top: 0;
    color: #333;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.jtee-reject-close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    margin-top: -10px;
}

.jtee-reject-close:hover {
    color: #000;
}

.jtee-reject-form-group {
    margin-bottom: 20px;
}

.jtee-reject-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.jtee-reject-form-group select,
.jtee-reject-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.jtee-reject-form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.jtee-reject-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.jtee-reject-info {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

.jtee-reject-count {
    background: #e3f2fd;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 600;
}

/* ===== Filter Styles ===== */
.jtee-filters {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.jtee-filters h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.jtee-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.jtee-filter-group {
    flex: 1;
    min-width: 150px;
}

.jtee-filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 13px;
}

.jtee-filter-group input[type="text"],
.jtee-filter-group input[type="number"],
.jtee-filter-group input[type="email"],
.jtee-filter-group input[type="date"],
.jtee-filter-group select {
    width: 100%;
    max-width: 100%;
}

.jtee-filter-buttons {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: center;
}

.jtee-export-button {
    margin-left: auto;
}

/* ===== Bulk Actions Styles (Admin Table) ===== */
.jtee-bulk-actions-table {
    background: #fff;
    border: 1px solid #ccd0d4;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.jtee-bulk-actions-table select {
    min-width: 120px;
}

.jtee-select-all-checkbox {
    margin-right: 10px;
}

.jtee-bulk-count {
    margin-left: auto;
    color: #666;
    font-size: 13px;
}

/* ===== Status Colors (consolidated) ===== */
.status-return-requested,
.wp-admin .status-return-requested,
.wp-admin .order-status.status-return-requested {
    color: #f39c12 !important;
    font-weight: bold;
}

.status-return-approved,
.wp-admin .status-return-approved,
.wp-admin .order-status.status-return-approved {
    color: #27ae60 !important;
    font-weight: bold;
}

.status-return-not-approved,
.wp-admin .status-return-not-approved,
.wp-admin .order-status.status-return-not-approved {
    color: #e74c3c !important;
    font-weight: bold;
}

.status-return-authorized,
.wp-admin .status-return-authorized,
.wp-admin .order-status.status-return-authorized {
    color: #0073aa !important;
    font-weight: bold;
}

.status-return-request-declined,
.wp-admin .status-return-request-declined,
.wp-admin .order-status.status-return-request-declined {
    color: #d63638 !important;
    font-weight: bold;
}

.status-return-under-inspection,
.wp-admin .status-return-under-inspection,
.wp-admin .order-status.status-return-under-inspection {
    color: #f39c12 !important;
    font-weight: bold;
}

/* ===== Mobile Adjustments for Admin Modals ===== */
@media (max-width: 600px) {
    .jtee-approve-content,
    .jtee-reject-content,
    .jtee-details-content {
        width: 95%;
        padding: 15px;
        margin: 10% auto;
    }
    
    .jtee-approve-content h3,
    .jtee-reject-content h3,
    .jtee-details-content h3 {
        font-size: 16px;
    }
    
    .jtee-filter-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .jtee-filter-group {
        min-width: 100%;
    }
    
    .jtee-bulk-actions-table {
        flex-wrap: wrap;
    }
    
    .jtee-bulk-actions-table select {
        width: 100%;
    }
    
    .jtee-attachments {
        justify-content: center;
    }
}