#history {
    display: none;
}

#history.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 20px;
    box-sizing: border-box;
}

#history-results {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg, #2a2a2a);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: var(--text-color, #ffffff);
}

.history-table th,
.history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color, #555);
}

.history-table th {
    background: var(--nav-bg, #333);
    font-weight: bold;
}

.history-table td a {
    color: var(--link-color, #4CAF50);
    text-decoration: none;
}

.history-table td a:hover {
    text-decoration: underline;
}

.history-table .success {
    color: var(--success-color, #4CAF50);
}

.history-table .failed {
    color: var(--error-color, red);
}

.history-table .pending {
    color: var(--text-color, #ffffff);
}

.history-table .redownload-btn,
.history-table .delete-btn {
    padding: 8px 12px;
    margin: 0 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--button-text, #ffffff);
}

.history-table .redownload-btn {
    background: var(--button-bg, #4CAF50);
}

.history-table .redownload-btn:hover {
    background: var(--button-hover-bg, #45a049);
}

.history-table .delete-btn {
    background: var(--error-color, red);
}

.history-table .delete-btn:hover {
    background: var(--error-hover-color, #cc0000);
}

#history-results p {
    text-align: center;
    color: var(--text-color, #ffffff);
    font-size: 1em;
}

@media (max-width: 600px) {
    #history {
        padding: 10px;
    }

    #history-results {
        max-width: 100%;
    }

    .history-table {
        font-size: 0.9em;
    }

    .history-table th,
    .history-table td {
        padding: 8px;
    }

    .history-table td a {
        display: inline-block;
        max-width: 100px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .history-table .redownload-btn,
    .history-table .delete-btn {
        padding: 6px 10px;
        font-size: 0.8em;
    }
}