body {
    font-family: Arial, sans-serif;
    background-color: #f9f9f9;
    color: #222;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    scroll-behavior: smooth;
}

header {
    background-color: #333;
    color: white;
    padding: 1em;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 1em;
    margin: 0;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

main {
    padding: 1em;
    max-width: 960px;
    margin: auto;
}

form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1em;
    margin-bottom: 2em;
}

input[type="text"] {
    padding: 0.5em;
    width: 100%;
    max-width: 400px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

button {
    padding: 0.5em 1em;
    background-color: #0077cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

    button:hover,
    #search-history li button:hover {
        background-color: #005fa3;
        color: inherit;
    }

.result-item, .favourite-item {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 1em 0;
    padding: 1em;
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
    align-items: flex-start;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

    .result-item img, .favourite-item img {
        max-width: 150px;
        height: auto;
        border-radius: 4px;
        object-fit: cover;
    }

.result-details, .favourite-details {
    flex: 1;
}

.visually-hidden {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

#search-history li button {
    background: none;
    border: none;
    color: #0077cc;
    cursor: pointer;
    padding: 0.3em;
    text-decoration: underline;
    font-size: 1em;
    transition: color 0.3s ease;
}

footer {
    text-align: center;
    padding: 1em;
    background-color: #eee;
    font-size: 0.9em;
    margin-top: 2em;
}

#loading {
    text-align: center;
    font-size: 1.2em;
    color: #555;
}

/* Animation for the loading spinner */
@keyframes pulse {
    0% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.4;
    }
}

.loading-spinner {
    animation: pulse 1.5s infinite;
}

@media (prefers-color-scheme: dark) {
    body {
        background-color: #1e1e1e;
        color: #eee;
    }

    header {
        background-color: #000;
    }

    nav a {
        color: #ccc;
    }

    .result-item, .favourite-item {
        background-color: #2a2a2a;
        border-color: #444;
    }

    button {
        background-color: #005fa3;
    }

    footer {
        background-color: #111;
        color: #ccc;
    }
}

@media (max-width: 600px) {
    .result-item, .favourite-item {
        flex-direction: column;
        align-items: center;
    }

    input[type="text"] {
        max-width: 100%;
    }

    nav ul {
        flex-direction: column;
    }
}
