/* Recent Items Styles */

/* Landing view recent items */
#recent-items-view {
    max-width: 100%;
    padding: 1rem;
    margin: 0 auto 10% auto;
    display: none !important;
}

.recent-card {
    transition: box-shadow 0.2s ease;
}

.recent-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Dark mode support for recent cards */
[data-bs-theme="dark"] .recent-card:hover {
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.1);
}

/* Recent items table styling */
.recent-items-table {
    margin: 0;
}

.recent-items-table th {
    border-top: none;
    font-weight: 600;
    color: var(--tblr-primary);
}

.recent-items-table td {
    vertical-align: middle;
}

.recent-item-row:hover {
    background-color: var(--tblr-bg-surface-secondary);
}

/* Dark mode table styling */
[data-bs-theme="dark"] .recent-items-table th {
    color: var(--tblr-primary-fg);
}

[data-bs-theme="dark"] .recent-item-row:hover {
    background-color: var(--tblr-bg-surface-tertiary);
}

/* Sidebar overlay */
.recent-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.recent-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Dark mode overlay */
[data-bs-theme="dark"] .recent-sidebar-overlay {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Sidebar content */
.recent-sidebar-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--tblr-bg-surface);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.recent-sidebar-overlay.active .recent-sidebar-content {
    transform: translateX(0);
}

/* Sidebar header */
.recent-sidebar-header {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--tblr-border-color);
    background-color: var(--tblr-bg-surface-secondary);
}

.recent-sidebar-header h3 {
    margin: 0;
    color: var(--tblr-body-color);
    flex-grow: 1;
}

.recent-sidebar-header .btn-close {
    margin-left: auto;
}

/* Dark mode header */
[data-bs-theme="dark"] .recent-sidebar-header {
    background-color: var(--tblr-bg-surface-dark);
    border-bottom-color: var(--tblr-border-color-dark);
}

/* Sidebar body */
.recent-sidebar-body {
    padding: 1.5rem;
}

/* Recent table container */
.recent-table-container {
    min-height: 200px;
    border-radius: 0.375rem;
    border: 1px solid var(--tblr-border-color);
    background-color: var(--tblr-bg-surface);
}

.recent-table-container .table {
    margin-bottom: 0;
    border-radius: 0.375rem;
    overflow: hidden;
}

/* Dark mode table container */
[data-bs-theme="dark"] .recent-table-container {
    border-color: var(--tblr-border-color-dark);
    background-color: var(--tblr-bg-surface-dark);
}

/* Tablender primary colors */
:root {
    --tablender-primary: #0066cc;
    --tablender-primary-dark: #004d99;
    --tablender-secondary: #f8f9fa;
    --tablender-secondary-dark: #343a40;
}

/* Override primary colors for tablender branding */
.recent-items-table th {
    color: var(--tablender-primary);
}

[data-bs-theme="dark"] .recent-items-table th {
    color: var(--tablender-primary);
}

/* Loading spinner colors */
.recent-table-container .spinner-border {
    color: var(--tablender-primary);
}

/* Responsive design */
@media (max-width: 768px) {
    .recent-sidebar-content {
        width: 100%;
    }
    
    #recent-items-view .row {
        margin: 0;
    }
    
    #recent-items-view .col-md-6 {
        padding: 0.5rem;
    }
    
    .recent-sidebar-body {
        padding: 1rem;
    }
}

/* Table responsive handling */
@media (max-width: 576px) {
    .recent-items-table td:first-child {
        max-width: 80px !important;
        font-size: 0.875rem;
    }
    
    .recent-items-table td:last-child {
        font-size: 0.875rem;
    }
}