body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    transition: background 0.3s, color 0.3s;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-section {
    margin: 20px 0;
}

input {
    padding: 8px;
    width: 250px;
}

button {
    padding: 8px 12px;
    cursor: pointer;
    margin-left: 5px;
}

#results, #favoritesList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.card {
    border: 1px solid #ddd;
    padding: 10px;
    background: white;
    border-radius: 6px;
    text-align: center;
}

.card img {
    width: 100%;
    border-radius: 6px;
}

.dark-mode {
    background-color: #222;
    color: white;
}

.dark-mode .card {
    background: #333;
}

#errorMessage {
    color: red;
    margin-top: 15px;
}

#historyList span {
    margin-right: 10px;
    cursor: pointer;
    color: blue;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 20px;
    width: 60%;
    max-height: 80%;
    overflow-y: auto;
    border-radius: 8px;
}

#closeModal {
    float: right;
    cursor: pointer;
    font-size: 24px;
}
