/* General Body Styling */
body {
    margin: 0;
    font-family: 'Inter', sans-serif; /* Using Inter for a modern look */
    overflow: hidden; /* Prevent scrolling due to floating GIFs */
    background-color: #121212; /* Darker background for depth */
    color: #e0e0e0; /* Softer white text */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Homepage Container */
#homepage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(to bottom right, #1a2a3a, #2a3a4a); /* Subtle, deeper gradient */
    z-index: 0; /* Ensure it's at the bottom layer */
}

/* GIF Dock Styling */
#gif-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(25, 25, 25, 0.95); /* Slightly less transparent, darker */
    padding: 20px; /* Increased padding */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 1px solid #4a4a4a; /* Subtle border */
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3); /* Soft shadow for depth */
    z-index: 1000; /* Ensure it's always on top */
}

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

.tab-button {
    background-color: #333;
    color: #e0e0e0;
    border: none;
    padding: 10px 25px; /* Increased padding */
    margin: 0 8px; /* Increased margin */
    border-radius: 25px; /* More rounded pills */
    cursor: pointer;
    font-size: 0.95em;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.tab-button:hover {
    background-color: #444;
    transform: translateY(-2px); /* Subtle lift on hover */
}

.tab-button.active {
    background-color: #007bff; /* Blue active tab color */
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.4);
}

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

#gif-search-input {
    flex-grow: 1;
    padding: 12px 15px; /* Increased padding */
    border: 1px solid #555;
    border-radius: 25px 0 0 25px; /* More rounded */
    background-color: #222;
    color: #e0e0e0;
    outline: none;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#gif-search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

#search-button {
    background-color: #007bff; /* Blue search button */
    color: white;
    border: none;
    padding: 12px 20px; /* Increased padding */
    border-radius: 0 25px 25px 0; /* More rounded */
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#search-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px); /* Subtle lift on hover */
}

/* GIF Results Area */
#gif-results {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px; /* Increased gap */
    max-height: 250px; /* Increased height for scrollability */
    overflow-y: auto;
    width: 100%;
    max-width: 800px;
    padding: 15px; /* Increased padding */
    background-color: rgba(30, 30, 30, 0.8); /* Darker background */
    border-radius: 12px; /* More rounded */
    margin-bottom: 20px;
    border: 1px solid #444; /* Softer border */
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2); /* Inner shadow */
}

#gif-results img {
    width: 110px; /* Slightly larger thumbnail size */
    height: 110px;
    object-fit: cover;
    border: 3px solid transparent; /* Thicker border */
    border-radius: 8px; /* More rounded */
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

#gif-results img:hover {
    border-color: #007bff; /* Blue hover border */
    transform: scale(1.08); /* More pronounced scale */
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.6);
}

#gif-results img.selected {
    border-color: #28a745; /* Green highlight for selected GIF */
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.7);
    transform: scale(1.08);
}

/* Drop GIF Button */
#drop-gif-button {
    background-color: #28a745; /* Green drop button */
    color: white;
    border: none;
    padding: 15px 35px; /* Increased padding */
    border-radius: 30px; /* Very rounded */
    cursor: pointer;
    font-size: 1.2em; /* Larger font */
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

#drop-gif-button:hover {
    background-color: #218838;
    transform: translateY(-3px); /* More pronounced lift */
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6);
}

#drop-gif-button:disabled {
    background-color: #555;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* 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, left 0.5s ease-out, top 0.5s ease-out; /* Added left/top to transition */
    pointer-events: none; /* Allow clicks to pass through to elements below */
    opacity: 0; /* Start hidden for animation */
    z-index: 1; /* Ensure GIFs are above homepage background but below dock */
}

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

.floating-gif.favorite-marked {
    border: 3px solid gold; /* Visual cue for favorites */
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
}

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

    .tabs {
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 15px;
    }

    .tab-button {
        padding: 8px 18px;
        margin: 5px;
        font-size: 0.9em;
    }

    .search-area {
        flex-direction: column;
        align-items: center;
        margin-bottom: 15px;
    }

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

    #search-button {
        width: 100%;
        border-radius: 25px;
        padding: 10px 15px;
    }

    #gif-results {
        max-height: 200px;
        gap: 8px;
        padding: 10px;
    }

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

    #drop-gif-button {
        padding: 12px 25px;
        font-size: 1.1em;
    }
}