/* Search History Modal Styles */
.history-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.history-modal.active {
    display: block;
    opacity: 1;
}

.history-modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    max-width: 800px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.4s ease-out;
}

.history-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s ease;
}

.history-close:hover,
.history-close:focus {
    color: #555;
}

.history-header {
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.history-header h2 {
    font-size: 1.8rem;
    color: #333;
    margin: 0;
    font-weight: 600;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.history-item {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    background-color: #f9f9f9;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 0.5s ease forwards;
    animation-delay: calc(var(--order) * 0.1s);
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.history-query {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 5px;
    font-weight: 500;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #777;
}

.history-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.history-search-btn {
    padding: 5px 10px;
    background-color: #4a6fa5;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.history-search-btn:hover {
    background-color: #3a5a8f;
}

.history-delete-btn {
    padding: 5px 10px;
    background-color: #f8f8f8;
    color: #d9534f;
    border: 1px solid #eee;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.history-delete-btn:hover {
    background-color: #fee;
    color: #c9302c;
}

.history-empty {
    text-align: center;
    padding: 40px 0;
    color: #888;
}

.history-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
    opacity: 0.5;
}

.history-pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 5px;
}

.history-pagination-btn {
    padding: 5px 12px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #555;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.history-pagination-btn:hover {
    background-color: #f5f5f5;
}

.history-pagination-btn.active {
    background-color: #4a6fa5;
    color: white;
    border-color: #4a6fa5;
}

.history-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.history-clear-btn {
    padding: 8px 15px;
    background-color: #f8f8f8;
    color: #777;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.history-clear-btn:hover {
    background-color: #fee;
    color: #d9534f;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}