/* History List Styles - Compact single-screen layout */

/* Block all scrolling on history list page */
html {
    overflow: hidden !important;
}

:root {
    --primary-color: #4361ee;
    --primary-light: #e0e7ff;
    --secondary-color: #3a0ca3;
    --accent-color: #f72585;
    --success-color: #4cc9f0;
    --warning-color: #f8961e;
    --danger-color: #ef233c;
    --text-color: #2b2d42;
    --text-light: #6c757d;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e9ecef;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --transition: all 0.3s ease-in-out; /* Default transition */
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow: hidden !important;
    height: 100vh;
}

/* Override content-blur for history list page */
.content-blur {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Override main-content for history list page */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* Override footer for history list page */
.main-footer {
    flex-shrink: 0;
    margin-top: 0 !important;
}

.history-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.25rem 2rem 0.5rem;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.history-header {
    background: linear-gradient(135deg, #2b2d42 0%, #353850 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.header-content h1 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    margin: 0 0 0.25rem 0;
    font-weight: 700;
    color: white;
}

.header-content h1 svg {
    width: 24px;
    height: 24px;
}

.header-content p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
    color: white;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: var(--transition);
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-secondary {
    background: #2b2d42;
    color: white;
}

.btn-secondary:hover {
    background: #1a1c2c;
    box-shadow: 0 0.25rem 0.75rem rgba(43, 45, 66, 0.3);
}

/* Stats cards */
.history-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.stat-card {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
    border: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.12);
}

/* Stat cards animation */
.stat-card {
    opacity: 0;
    transform: translateY(10px);
}

.stat-card.fade-in-delayed {
    animation: none;
}

.stat-card.fade-in-delayed.show {
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: var(--delay, 0ms);
}

.stat-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    color: white;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 26px;
    height: 26px;
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.stat-icon.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #f3722c 100%);
}

.stat-icon.info {
    background: linear-gradient(135deg, var(--success-color) 0%, #4895ef 100%);
}

.stat-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-top: 5px;
}

/* Tabs */
.history-tabs {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.tabs-header {
    display: flex;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    position: relative;
}

.tab-btn {
    padding: 10px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-light);
    position: relative;
    font-size: 0.9rem;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
    transition: color 0.3s ease;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn:hover:not(.active) {
    color: var(--text-color);
}

/* Animated indicator for active tab */
.tabs-header .active-tab-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: left 0.4s cubic-bezier(0.23, 1, 0.32, 1), width 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.tabs-content {
    padding: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.tab-pane {
    display: flex;
    flex-grow: 1;
    flex-direction: column;
    min-height: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s;
}

.tab-pane.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

/* History list */
.history-list {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 100%;
    padding: 8px 4px;
}

.history-list.loading {
    opacity: 0.7;
    pointer-events: none;
}

.history-item {
    display: flex;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px;
    margin: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: white;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.history-item:hover {
    background: var(--bg-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-bottom: 1px solid var(--border-color);
}

/* Animation classes for smooth entry */
.history-item.fade-in {
    opacity: 0;
    transform: translateY(15px);
}

.history-item.fade-in.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Faster animations for cached content */
.history-item.fade-in-fast {
    opacity: 0;
    transform: translateY(10px);
}

.history-item.fade-in-fast.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Ensure items remain visible when not animating */
.history-item:not(.fade-in):not(.fade-in-fast) {
    opacity: 1;
    transform: translateY(0);
}

.item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 8px;
    color: var(--text-light);
    flex-shrink: 0;
    min-width: 40px;
}

.item-icon.success {
    background: #d1fae5;
    color: #065f46;
}

.item-icon.error {
    background: #fee2e2;
    color: #b91c1c;
}

.item-icon.deactivated {
    background: #fee2e2;
    color: #dc2626;
}

.item-icon.updated {
    background: #dbeafe;
    color: #2563eb;
}

.item-icon.created {
    background: #d1fae5;
    color: #059669;
}

/* Color variations for different history item types */
.history-item.type-deactivated {
    border-left-color: #ef233c;
}

.history-item.type-notifications {
    border-left-color: #f8961e;
}

.history-item.type-actions {
    border-left-color: #4361ee;
}

.item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.item-content h4 {
    margin: 0 0 4px 0;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}

.item-details {
    margin: 0;
    color: var(--text-light);
    font-size: 0.8rem;
}

.item-details span {
    margin-right: 10px;
    display: inline-block;
}

.item-message {
    margin: 2px 0 4px 0;
    color: var(--text-color);
    line-height: 1.3;
    font-size: 0.85rem;
}

.item-meta {
    margin: 0;
    color: var(--text-light);
    font-size: 0.75rem;
    line-height: 1.2;
}

/* Item actions - for properties tab */
.item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 12px;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: var(--bg-color);
    color: var(--text-light);
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-action.btn-restore {
    background: #d1fae5;
    color: #059669;
}

.btn-action.btn-restore:hover {
    background: #a7f3d0;
    color: #047857;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

.btn-action.btn-delete {
    background: #fee2e2;
    color: #dc2626;
}

.btn-action.btn-delete:hover {
    background: #fca5a5;
    color: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-action svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.05) 0%, rgba(250, 204, 21, 0.05) 100%);
    border-radius: 12px;
    margin: 12px;
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.4;
    width: 56px;
    height: 56px;
}

.empty-state h3 {
    margin: 0 0 8px 0;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.empty-state p {
    margin: 0;
    font-size: 0.9rem;
    max-width: 300px;
}

/* Loader for tabs */
.tab-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-light);
    flex-grow: 1;
}

.loading-dots {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.loading-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
    animation: dot-bounce 1.4s infinite ease-in-out both;
}

.loading-dots .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots .dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dot-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.error-state {
    text-align: center;
    padding: 40px;
    color: var(--danger-color);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 4px;
    padding: 4px 15px;
    flex-shrink: 0;
}

.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.pagination-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card-bg);
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 500;
}

.loading-content .mini-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary-light);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

.pagination a,
.pagination .page-btn,
.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    border: none;
    background: white;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0 8px;
    transition: var(--transition);
}

.pagination .page-link.first,
.pagination .page-link.last,
.pagination .page-link.prev,
.pagination .page-link.next {
    min-width: auto;
    width: auto;
    padding: 0 12px;
    gap: 4px;
}

.pagination .page-link svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.pagination a:hover,
.pagination .page-btn:hover,
.pagination .page-link:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination .page-btn.current,
.pagination .page-link.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-btn:disabled,
.pagination .page-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-color);
}

.pagination .page-btn:disabled:hover,
.pagination .page-link:disabled:hover {
    background: var(--bg-color);
    border-color: var(--border-color);
    color: var(--text-light);
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0 15px;
    white-space: nowrap;
}

/* Notifications for AJAX operations */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    z-index: 1000;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.hiding {
    transform: translateX(120%);
    opacity: 0;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-icon {
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
}

.notification-success {
    border-left: 4px solid var(--success-color);
}

.notification-error {
    border-left: 4px solid var(--danger-color);
}

.notification-info {
    border-left: 4px solid var(--primary-color);
}

/* Global loader overlay */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading-overlay {
    text-align: center;
    color: var(--primary-color);
}

.loading-overlay p {
    margin-top: 16px;
    font-weight: 500;
}

/* Improved smooth animations */
.history-item {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.history-item:not(.aos-animate) {
    opacity: 0;
    transform: translateY(20px);
}

/* Loading spinners */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--primary-light);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tab loading state */
.tab-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--primary-color);
    font-weight: 500;
}

.tab-loading .loading-spinner {
    margin-bottom: 16px;
}

.tab-loading p {
    margin: 0;
    color: var(--text-color);
}

/* Tab switching improvements */
.tabs-content {
    position: relative;
}

.tab-pane {
    opacity: 1;
}

.tab-pane:not(.active) {
    opacity: 0;
    pointer-events: none;
}

/* Enhanced pagination loading */
.pagination-loading {
    position: relative;
}

.pagination-loading .pagination {
    opacity: 0.5;
    pointer-events: none;
}

.pagination-loading .loading-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* Improved empty state */
.empty-state {
    background: var(--bg-color);
    border-radius: 12px;
    margin: 20px;
    padding: 40px 20px;
}

/* Enhanced error state */
.error-state {
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    margin: 20px;
    padding: 40px 20px;
}

.error-state svg {
    margin-bottom: 16px;
}

.error-state h3 {
    color: var(--danger-color);
    margin: 0 0 8px 0;
    font-size: 1.2rem;
}

.error-state p {
    color: var(--text-light);
    margin: 0 0 20px 0;
}

/* Button pulse animation */
.btn.pulse {
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Shake animation for delete confirmation */
@keyframes shake {
    0%, 20%, 40%, 60%, 80% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
}

/* Fade in up animation for stat cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark Mode Theme Styles for History Page */
html.dark-mode {
    --primary-color: #4cc9f0;
    --primary-light: #1a3a4a;
    --secondary-color: #3db5e8;
    --accent-color: #f72585;
    --success-color: #4cc9f0;
    --warning-color: #7c8db0;
    --danger-color: #ef233c;
    --text-color: #e4e4e7;
    --text-light: #a0a0b8;
    --bg-color: #1a1a2e;
    --card-bg: #27273a;
    --border-color: #3a3a4f;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
}

html.dark-mode body {
    background-color: #1a1a2e;
    color: #e4e4e7;
}

/* Dark mode history header - same color as light mode */
html.dark-mode .history-header {
    background: linear-gradient(135deg, #2b2d42 0%, #353850 100%);
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.4);
}

html.dark-mode .header-content h1 {
    color: #f0f0f0;
}

html.dark-mode .header-content p {
    color: rgba(240, 240, 240, 0.8);
}

/* Dark mode stat cards */
html.dark-mode .stat-card {
    background: #27273a;
    border-color: #3a3a4f;
    color: #e4e4e7;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.3);
}

html.dark-mode .stat-card:hover {
    background: #2d2d40;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.4);
}

/* Dark mode stat icons - same as light mode */
html.dark-mode .stat-icon.primary {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
}

html.dark-mode .stat-icon.warning {
    background: linear-gradient(135deg, #f8961e 0%, #f3722c 100%);
}

html.dark-mode .stat-icon.info {
    background: linear-gradient(135deg, #4cc9f0 0%, #4895ef 100%);
}

html.dark-mode .stat-number {
    color: #f0f0f0;
}

html.dark-mode .stat-label {
    color: #a0a0b8;
}

/* Dark mode tabs */
html.dark-mode .history-tabs {
    background: #27273a;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.3);
}

html.dark-mode .tabs-header {
    background: #1a1a2e;
    border-bottom-color: #3a3a4f;
}

html.dark-mode .tab-btn {
    color: #a0a0b8;
}

html.dark-mode .tab-btn.active {
    color: #4cc9f0;
    background: #27273a;
}

html.dark-mode .tabs-header .active-tab-indicator {
    background: #4cc9f0;
}

html.dark-mode .tab-btn:hover:not(.active) {
    background: rgba(76, 201, 240, 0.1);
    color: #e4e4e7;
}

/* Dark mode history items - base styling */
html.dark-mode .history-item {
    background: #27273a;
    border-color: #3a3a4f;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html.dark-mode .history-item:hover {
    background: #2d2d40;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
}

/* Dark mode deactivated offers styling */
html.dark-mode .history-item.type-deactivated {
    border-left-color: #ef233c;
    background: linear-gradient(135deg, rgba(27, 27, 42, 0.9) 0%, rgba(45, 35, 45, 0.7) 100%);
}

html.dark-mode .history-item.type-deactivated:hover {
    background: linear-gradient(135deg, rgba(27, 27, 42, 1) 0%, rgba(50, 40, 50, 1) 100%);
    border-left-color: #ff4444;
}

/* Dark mode notifications styling */
html.dark-mode .history-item.type-notifications {
    border-left-color: #f8961e;
    background: linear-gradient(135deg, rgba(27, 27, 42, 0.9) 0%, rgba(45, 40, 27, 0.7) 100%);
}

html.dark-mode .history-item.type-notifications:hover {
    background: linear-gradient(135deg, rgba(27, 27, 42, 1) 0%, rgba(50, 45, 30, 1) 100%);
    border-left-color: #ffa500;
}

/* Dark mode actions history styling */
html.dark-mode .history-item.type-actions {
    border-left-color: #4cc9f0;
    background: linear-gradient(135deg, rgba(27, 27, 42, 0.9) 0%, rgba(35, 42, 50, 0.7) 100%);
}

html.dark-mode .history-item.type-actions:hover {
    background: linear-gradient(135deg, rgba(27, 27, 42, 1) 0%, rgba(40, 48, 55, 1) 100%);
    border-left-color: #5dd9ff;
}

/* Dark mode item icons - same as light mode */
html.dark-mode .item-icon {
    background: var(--bg-color);
    color: var(--text-light);
}

html.dark-mode .item-icon.success {
    background: #d1fae5;
    color: #065f46;
}

html.dark-mode .item-icon.error {
    background: #fee2e2;
    color: #b91c1c;
}

html.dark-mode .item-icon.deactivated {
    background: #fee2e2;
    color: #dc2626;
}

html.dark-mode .item-icon.updated {
    background: #dbeafe;
    color: #2563eb;
}

html.dark-mode .item-icon.created {
    background: #d1fae5;
    color: #059669;
}

/* Dark mode item content */
html.dark-mode .item-content h4 {
    color: #f0f0f0;
}

html.dark-mode .item-message {
    color: #e4e4e7;
}

html.dark-mode .item-meta {
    color: #a0a0b8;
}

/* Dark mode action buttons */
html.dark-mode .btn-secondary {
    background: #3a3a4f;
    color: #e4e4e7;
    border-color: #3a3a4f;
}

html.dark-mode .btn-secondary:hover {
    background: #4a4a5f;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.4);
}

/* Dark mode action item buttons */
html.dark-mode .btn-action {
    background: #3a3a4f;
    color: #a0a0b8;
}

html.dark-mode .btn-action:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html.dark-mode .btn-action.btn-restore {
    background: rgba(76, 201, 240, 0.15);
    color: #4cc9f0;
}

html.dark-mode .btn-action.btn-restore:hover {
    background: rgba(76, 201, 240, 0.25);
    color: #5dd9ff;
    box-shadow: 0 4px 12px rgba(76, 201, 240, 0.2);
}

html.dark-mode .btn-action.btn-delete {
    background: rgba(239, 35, 60, 0.15);
    color: #ff6b6b;
}

html.dark-mode .btn-action.btn-delete:hover {
    background: rgba(239, 35, 60, 0.25);
    color: #ff8888;
    box-shadow: 0 4px 12px rgba(239, 35, 60, 0.2);
}

/* Dark mode empty state */
html.dark-mode .empty-state {
    background: linear-gradient(135deg, rgba(76, 201, 240, 0.05) 0%, rgba(67, 97, 238, 0.05) 100%);
    border: 1px solid rgba(76, 201, 240, 0.1);
}

html.dark-mode .empty-state h3 {
    color: #f0f0f0;
}

html.dark-mode .empty-state p {
    color: #a0a0b8;
}

html.dark-mode .empty-state svg {
    opacity: 0.3;
}

/* Dark mode error state */
html.dark-mode .error-state {
    background: rgba(239, 35, 60, 0.1);
    border-color: rgba(239, 35, 60, 0.3);
}

html.dark-mode .error-state h3 {
    color: #ff6b6b;
}

html.dark-mode .error-state p {
    color: #a0a0b8;
}

/* Dark mode loading state */
html.dark-mode .loading-spinner {
    border-color: rgba(76, 201, 240, 0.2);
    border-top-color: #4cc9f0;
}

html.dark-mode .tab-loading {
    color: #4cc9f0;
}

html.dark-mode .tab-loading p {
    color: #e4e4e7;
}

/* Dark mode pagination */
html.dark-mode .pagination a,
html.dark-mode .pagination .page-btn,
html.dark-mode .pagination .page-link {
    background: #27273a;
    color: #e4e4e7;
    border-color: #3a3a4f;
}

html.dark-mode .pagination a:hover,
html.dark-mode .pagination .page-btn:hover {
    background: #3a3a4f;
    border-color: #4cc9f0;
}

html.dark-mode .pagination .page-link.current {
    background: #4cc9f0;
    color: #0f0f1e;
}

/* Dark mode loading content overlay */
html.dark-mode .pagination-loading .loading-content {
    background: #27273a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

html.dark-mode .loading-content {
    color: #4cc9f0;
}

html.dark-mode .loading-content .mini-spinner {
    border-color: rgba(76, 201, 240, 0.2);
    border-top-color: #4cc9f0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .history-header {
        width: 100%;
    }

    .history-container {
        max-width: 100%;
        padding: 0.25rem 1rem 0.5rem;
    }
}

@media (max-width: 768px) {
    html, body {
        overflow: auto !important;
        height: auto;
    }

    .history-container {
        padding: 1rem;
    }

    .history-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .stat-card {
        padding: 1rem;
        flex-direction: row;
        align-items: center;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .history-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .header-actions {
        justify-content: flex-end;
    }

    .tabs-header {
        overflow-x: auto;
    }

    .tab-btn {
        flex-shrink: 0;
    }

    .history-item {
        flex-direction: column;
        gap: 0.75rem;
    }

    .item-actions {
        flex-direction: row;
        justify-content: flex-start;
        padding-left: 0;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .content-blur {
        display: flex;
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: visible;
        min-height: 0;
    }

    .history-container {
        padding: 0.75rem;
        max-width: 100%;
        overflow: visible;
        flex: none;
        height: auto;
    }

    .history-header {
        padding: 0.75rem;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .header-content h1 {
        font-size: 1.2rem;
    }

    .header-content p {
        font-size: 0.8rem;
    }

    .btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .tab-btn {
        padding: 4px 4px;
        font-size: 0.65rem;
        flex: 1;
        min-width: 0;
        text-align: center;
        white-space: normal;
        word-break: break-word;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1.2;
    }
    
    .tabs-header {
        display: flex;
        flex-wrap: nowrap;
        gap: 0;
    }

    .history-item {
        padding: 0.75rem;
        margin: 6px;
    }

    .item-content h4 {
        font-size: 0.9rem;
    }

    .item-details, .item-message, .item-meta {
        font-size: 0.75rem;
    }

    .pagination-container {
        padding: 4px 8px;
    }

    .pagination {
        gap: 4px;
    }

    .pagination a, .pagination .page-btn, .pagination .page-link {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .history-tabs {
        height: auto;
        margin-bottom: 1rem;
    }

    .tab-pane {
        position: relative;
        height: auto;
        opacity: 0;
        visibility: hidden;
        display: none;
    }

    .tab-pane.active {
        opacity: 1;
        visibility: visible;
        display: flex;
        flex-direction: column;
    }

    .history-list {
        overflow: visible;
        max-height: none;
        padding: 8px 4px;
    }
}
