
:root {
    --primary-color: #007bff;
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --on-surface-color: #e0e0e0;
    --on-surface-color-muted: #a0a0a0;
    --border-color: #333;
    --success-color: #28a745;
    --danger-color: #dc3545;
}

.history-header {
    width: 100%;
    max-width: 900px;
    margin-bottom: 30px;
    text-align: center;
}

#auth-check {
    text-align: center;
    font-size: 1.2rem;
    color: var(--on-surface-color-muted);
}

#auth-check a {
    color: var(--primary-color);
}

#history-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    gap: 15px;
}

.filter-group {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.filter-btn {
    padding: 10px 20px;
    background-color: var(--surface-color);
    color: var(--on-surface-color);
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.filter-btn:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.filter-btn:hover {
    background-color: #444;
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
}

#history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    justify-content: center; /* Center the grid items */
    overflow-y: auto; /* Add this line */
    max-height: calc(100vh - 250px); /* Add this line */
}

.history-item-container {
    position: relative;
}

.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.history-item-container:hover .delete-btn {
    opacity: 1;
}

.history-item {
    background-color: var(--surface-color);
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    display: block; /* Make the anchor a block element */
    text-decoration: none; /* Remove underline from link */
}

.history-item img {
    width: 100%;
    height: auto;
    display: block;
}

.history-item .vote-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 8px 0;
    color: white;
    font-weight: bold;
}

.vote-overlay.good {
    background-color: rgba(40, 167, 69, 0.85);
}

.vote-overlay.bad {
    background-color: rgba(220, 53, 69, 0.85);
}

#loading-state {
    text-align: center;
}

.back-link {
    display: block;
    margin-top: 10px;
    color: var(--on-surface-color-muted);
    text-decoration: none;
    font-size: 14px;
}
.back-link:hover {
    text-decoration: underline;
}
