/* General Body Styling */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    overflow: hidden; /* Prevent scrolling due to floating GIFs */
    background-color: #1a1a1a; /* Dark background for contrast */
    color: #ffffff;
}

/* Homepage Container */
#homepage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(to bottom right, #2c3e50, #34495e); /* Subtle gradient */
}

/* GIF Dock Styling */
#gif-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent dark background */
    padding: 15px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 2px solid #4CAF50; /* Accent border */
    z-index: 1000; /* Ensure it's above GIFs */
}

/* Tabs Styling */
.tabs {
    display: flex;
    margin-bottom: 15px;
}

.tab-button {
    background-color: #555;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 0 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.tab-button:hover {
    background-color: #777;
}

.tab-button.active {
    background-color: #4CAF50; /* Active tab color */
    font-weight: bold;
}

/* Search Area Styling */
.search-area {
    display: flex;
    width: 100%;
    max-width: 500px;
    margin-bottom: 15px;
}

#gif-search-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #777;
    border-radius: 5px 0 0 5px;
    background-color: #333;
    color: white;
    outline: none;
}

#search-button {
    background-color: #007bff; /* Blue search button */
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#search-button:hover {
    background-color: #0056b3;
}

/* GIF Results Area */
#gif-results {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-height: 200px; /* Limit height for scrollability */
    overflow-y: auto;
    width: 100%;
    max-width: 800px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #555;
}

#gif-results img {
    width: 100px; /* Thumbnail size */
    height: 100px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

#gif-results img:hover {
    border-color: #4CAF50;
    transform: scale(1.05);
}

#gif-results img.selected {
    border-color: #007bff; /* Highlight selected GIF */
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.7);
}

/* Drop GIF Button */
#drop-gif-button {
    background-color: #28a745; /* Green drop button */
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

#drop-gif-button:hover {
    background-color: #218838;
}

/* Floating GIF Styling */
.floating-gif {
    position: absolute;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out; /* For initial animation */
    pointer-events: none; /* Allow clicks to pass through to elements below */
    opacity: 0; /* Start hidden for animation */
}

.floating-gif.active {
    opacity: 1; /* Fade in */
}

/* Responsive Design */
@media (max-width: 768px) {
    #gif-dock {
        padding: 10px;
    }

    .tabs {
        flex-wrap: wrap;
        justify-content: center;
    }

    .tab-button {
        padding: 8px 15px;
        margin: 5px;
    }

    .search-area {
        flex-direction: column;
        align-items: center;
    }

    #gif-search-input {
        width: 100%;
        border-radius: 5px;
        margin-bottom: 10px;
    }

    #search-button {
        width: 100%;
        border-radius: 5px;
    }

    #gif-results {
        max-height: 150px;
    }

    #gif-results img {
        width: 80px;
        height: 80px;
    }

    #drop-gif-button {
        padding: 10px 20px;
        font-size: 1em;
    }
}