/* Reminder Management Specific Styles */

/* Inherit base styles from shared-sidebar.css */

/* Table Styles */
.table th {
    font-weight: 600;
    font-size: 0.9rem;
    border-top: none;
    background-color: #343a40;
    color: white;
    padding: 12px 8px;
}

.table td {
    padding: 10px 8px;
    vertical-align: middle;
    font-size: 0.9rem;
    border-top: 1px solid #dee2e6;
}

/* General table hover effect */
.table tbody tr:hover {
    background-color: #e3f2fd;
}

/* Specific reminder table hover effect */
#reminderTable.table-hover tbody tr:hover,
#reminderTable tbody tr:hover,
#reminderTable tr:hover {
    background-color: #e3f2fd !important;
    transition: background-color 0.2s ease;
}

#reminderTable.table-hover tbody tr:hover td,
#reminderTable tbody tr:hover td,
#reminderTable tr:hover td {
    background-color: #e3f2fd !important;
    transition: background-color 0.2s ease;
}

/* Priority Badge Styles */
.priority-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.priority-low {
    background-color: #d4edda;
    color: #155724;
}

.priority-medium {
    background-color: #fff3cd;
    color: #856404;
}

.priority-high {
    background-color: #f8d7da;
    color: #721c24;
}

.priority-critical {
    background-color: #f5c6cb;
    color: #721c24;
    font-weight: 600;
}

/* Status Badge Styles */
.status-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-active {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-completed {
    background-color: #d4edda;
    color: #155724;
}

.status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.status-expired {
    background-color: #e2e3e5;
    color: #6c757d;
}

/* Type Badge Styles */
.type-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    background-color: #e9ecef;
    color: #495057;
}

/* Action Buttons */
.action-btn {
    padding: 3px 6px;
    margin: 0 1px;
    font-size: 0.75rem;
    border-radius: 4px;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Message Preview */
.message-preview {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.message-preview:hover {
    color: #0d6efd;
}

/* Expired Row Styling */
.table tbody tr.expired {
    background-color: #f8f9fa;
    opacity: 0.7;
}

.table tbody tr.expired td {
    color: #6c757d;
}

/* Team Assignment Highlighting */
.assigned-to-team {
    color: #0d6efd !important;
    font-weight: bold;
}

/* Modal Styles */
.modal-body .form-label {
    font-weight: 500;
    color: #495057;
}

.modal-body .form-control,
.modal-body .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Search Container */
.search-container {
    position: relative;
    width: 300px;
}

.search-container .form-control {
    padding-right: 40px;
    border-radius: 20px;
}

.search-container .search-icon,
.search-container .clear-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 10;
}

.search-container .clear-icon:hover {
    color: #dc3545;
}

/* Action Bar */
.action-bar {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.action-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Filter Dropdown */
.dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
}

/* Pagination */
.pagination .page-link {
    border-radius: 6px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    color: #28a745;
    background-color: #fff;
    transition: all 0.2s ease;
}

.pagination .page-link:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.pagination .page-item.active .page-link {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
    font-weight: 600;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background-color: #f8f9fa;
    border-color: #dee2e6;
    cursor: not-allowed;
}

.pagination .page-item.disabled .page-link:hover {
    color: #6c757d;
    background-color: #f8f9fa;
    border-color: #dee2e6;
    transform: none;
    box-shadow: none;
}

/* Loading States */
.loading-component {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.progress-container-component {
    width: 200px;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar-component {
    height: 100%;
    background: linear-gradient(90deg, #0d6efd, #6610f2);
    border-radius: 2px;
    animation: progress-animation 1.5s ease-in-out infinite;
}

.loading-text-component {
    color: #6c757d;
    font-size: 0.9rem;
}

@keyframes progress-animation {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Table Responsive Fixes for Mobile Horizontal Scrolling */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

/* Ensure table has minimum width for horizontal scrolling */
#reminderTable,
#dashboardReminderTable {
    min-width: 800px;
    width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-container {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .action-left {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-left .btn {
        margin: 2px 0;
    }
    
    .table-responsive {
        font-size: 0.8rem;
        margin: 0 -15px; /* Extend to full width on mobile */
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    
    .table th,
    .table td {
        padding: 8px 4px;
        white-space: nowrap; /* Prevent text wrapping */
    }
    
    .message-preview {
        max-width: 120px;
    }
    
    .action-btn {
        padding: 2px 4px;
        font-size: 0.7rem;
    }
    
    /* Ensure dashboard reminder table also scrolls horizontally */
    .my-reminders-panel .table-responsive {
        margin: 0;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
    }
}

@media (max-width: 576px) {
    /* All columns are now shown and scrollable horizontally */
    
    .merchant-column {
        min-width: 100px;
        max-width: 130px;
    }
    
    .merchant-info {
        gap: 4px;
    }
    
    .merchant-id-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
        min-width: 30px;
    }
    
    .merchant-name-text {
        font-size: 0.7rem;
    }
    
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-body .row .col-md-6 {
        margin-bottom: 10px;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #dee2e6;
}

.empty-state h4 {
    color: #495057;
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 20px;
}

/* Toast Notifications */
.toast {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.toast-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.toast-icon {
    margin-right: 8px;
}

/* Data Table Enhancements */
.table tbody tr {
    transition: all 0.2s ease;
}

/* Enhanced table hover effect with transform */
.table tbody tr:hover {
    background-color: #e3f2fd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Specific reminder table enhanced hover effect */
#reminderTable.table-hover tbody tr:hover,
#reminderTable tbody tr:hover,
#reminderTable tr:hover {
    background-color: #e3f2fd !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

/* Form Validation */
.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    display: block;
    font-size: 0.875rem;
    color: #dc3545;
}

/* Custom Scrollbar */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* User's Own Reminder Highlighting */
.reminder-row-own {
    background-color: #e3f2fd !important;
    border-left: 5px solid #2196f3 !important;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.1) !important;
}

.reminder-row-own:hover {
    background-color: #bbdefb !important;
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.2) !important;
}

.reminder-row-own td {
    border-top: 1px solid #bbdefb !important;
    border-bottom: 1px solid #bbdefb !important;
}

.reminder-row-own .assigned-to-own {
    font-weight: 600;
    color: #1976d2;
}

/* Highlight the title column for user's own reminders */
.reminder-row-own td:first-child {
    background-color: rgba(33, 150, 243, 0.1) !important;
    font-weight: bold;
}

.reminder-row-own td:first-child:hover {
    background-color: rgba(33, 150, 243, 0.2) !important;
}

/* Time remaining styling */
.time-remaining-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Created date column styling - same as expire date */
.created-date-column .time-remaining-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.created-date-column .time-remaining {
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
}

.created-date-column .expire-date {
    font-size: 0.75rem;
    color: #6c757d;
    opacity: 0.8;
    white-space: nowrap;
}

.time-remaining {
    font-weight: 500;
    white-space: nowrap;
}

.time-remaining i {
    margin-right: 4px;
}

.expire-date {
    font-size: 0.8rem;
    opacity: 0.8;
    white-space: nowrap;
}

/* Merchant column - horizontal layout */
.merchant-column {
    min-width: 140px;
    max-width: 180px;
    font-size: 0.8rem;
}

.merchant-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.merchant-id-badge {
    background-color: #e9ecef;
    color: #495057;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
    min-width: 35px;
    text-align: center;
    flex-shrink: 0;
}

.merchant-name-text {
    color: #495057;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    font-weight: 500;
    flex: 1;
    min-width: 0;
}

/* Make the status column compact */
.table th:nth-child(6),
.table td:nth-child(6) {
    min-width: 80px;
    width: 80px;
}

/* Make the table more compact overall */
#reminderTable {
    font-size: 0.85rem;
}

#reminderTable th,
#reminderTable td {
    padding: 0.4rem 0.5rem;
}

/* Make the created date column compact */
.table th:nth-child(7),
.table td:nth-child(7) {
    min-width: 120px;
    width: 120px;
}

/* Make the expire date column wider to accommodate both time and date */
.table th:nth-child(8),
.table td:nth-child(8) {
    min-width: 140px;
    width: 140px;
}

/* Make the actions column compact for Edit/Delete buttons */
.table th:nth-child(10),
.table td:nth-child(10) {
    min-width: 80px;
    width: 80px;
}

/* Make the quick status column for Ongoing/Done buttons */
.table th:nth-child(11),
.table td:nth-child(11) {
    min-width: 100px;
    width: 100px;
}

/* Done reminder row styling - grayed out */
.reminder-row-done {
    background-color: #f8f9fa !important;
    opacity: 0.7;
    color: #6c757d !important;
}

.reminder-row-done:hover {
    background-color: #e9ecef !important;
    opacity: 0.8;
}

.reminder-row-done td {
    border-top: 1px solid #e9ecef !important;
    border-bottom: 1px solid #e9ecef !important;
    color: #6c757d !important;
}

.reminder-row-done strong {
    color: #6c757d !important;
    text-decoration: line-through;
}

.reminder-row-done .status-badge {
    opacity: 0.6;
}

.reminder-row-done .priority-badge {
    opacity: 0.6;
}

.reminder-row-done .type-badge {
    opacity: 0.6;
}

/* Expired reminder row styling - highlighted with warning */
.reminder-row-expired {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107 !important;
    animation: expiredPulse 2s infinite;
}

.reminder-row-expired:hover {
    background-color: #ffeaa7 !important;
}

.reminder-row-expired td {
    border-top: 1px solid #ffeaa7 !important;
    border-bottom: 1px solid #ffeaa7 !important;
}

.reminder-row-expired strong {
    color: #856404 !important;
    font-weight: bold;
}

/* Expired pulse animation */
@keyframes expiredPulse {
    0% { 
        background-color: #fff3cd;
        border-left-color: #ffc107;
    }
    50% { 
        background-color: #ffeaa7;
        border-left-color: #f39c12;
    }
    100% { 
        background-color: #fff3cd;
        border-left-color: #ffc107;
    }
}

/* Urgent time remaining (less than 1 hour) */
.time-urgent {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Status buttons styling */
.status-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Quick status buttons - more compact */
.status-buttons .status-btn {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    min-width: 70px;
}

/* Disabled status buttons */
.status-buttons .status-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.status-buttons .status-btn.disabled:hover {
    opacity: 0.5;
    transform: none;
}

.status-btn {
    font-size: 0.75rem;
    padding: 4px 8px;
    white-space: nowrap;
    min-width: 80px;
}

.status-btn i {
    margin-right: 4px;
}

/* Status badge styling for new values */
.status-new {
    background-color: #6c757d;
    color: white;
}

.status-ongoing {
    background-color: #28a745;
    color: white;
}

.status-cancelled {
    background-color: #ffc107;
    color: #212529;
}

.status-done {
    background-color: #007bff;
    color: white;
}
