/* File History Widget */
.file-history-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    max-height: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 1rem;
    z-index: 999;
    transition: all 0.3s;
    overflow: hidden;
}

[data-theme="dark"] .file-history-widget {
    background: rgba(30, 30, 50, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.file-history-widget.collapsed {
    max-height: 50px;
    cursor: pointer;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    cursor: pointer;
}

.history-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

[data-theme="dark"] .history-title {
    color: #e0e0e0;
}

.history-toggle {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.file-history-widget.collapsed .history-toggle {
    transform: rotate(180deg);
}

.history-content {
    max-height: 300px;
    overflow-y: auto;
}

.file-history-widget.collapsed .history-content {
    display: none;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    transition: all 0.2s;
    cursor: pointer;
}

.history-item:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(-3px);
}

[data-theme="dark"] .history-item {
    background: rgba(102, 126, 234, 0.15);
}

[data-theme="dark"] .history-item:hover {
    background: rgba(102, 126, 234, 0.25);
}

.history-icon {
    font-size: 1.5rem;
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-filename {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="dark"] .history-filename {
    color: #e0e0e0;
}

.history-meta {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.2rem;
}

[data-theme="dark"] .history-meta {
    color: #999;
}

.history-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #999;
    font-size: 0.9rem;
}

.history-clear-btn {
    width: 100%;
    padding: 0.6rem;
    margin-top: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.history-clear-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .history-clear-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* Custom scrollbar */
.history-content::-webkit-scrollbar {
    width: 6px;
}

.history-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.history-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 10px;
}

.history-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .file-history-widget {
        bottom: 10px;
        right: 10px;
        width: calc(100% - 20px);
        max-width: 300px;
    }
}

/* Hide on very small screens */
@media (max-width: 480px) {
    .file-history-widget {
        width: 60px;
        padding: 0.5rem;
    }

    .file-history-widget:not(.collapsed) {
        width: calc(100% - 20px);
        padding: 1rem;
    }

    .history-title span {
        display: none;
    }

    .file-history-widget:not(.collapsed) .history-title span {
        display: inline;
    }
}
