/* file: /css/storybot-grid-music-style.css */

/* Main Layout */
/* Desktop layout */
.music-grid-layout {
    display: grid;
    grid-template-columns: 0.5fr 2fr 2fr; /* Adjust as needed */
    gap: 20px;
    padding: 20px;
    width: 100%;
}

.music-grid-layout h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

/* Styling for the search box */
.search-box-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    margin-top: 25px;
    max-width: 600px;
    margin: 15px auto 20px;
}

#song-search-box {
    width: 100%;
    padding: 10px 40px 10px 10px; /* Add proper padding to the right for the icon */
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box; /* Ensure padding is included in the box model */
}

#song-search-box:focus {
    border-color: #5c6bc0; /* Matches button color */
    outline: none;
    box-shadow: 0 0 5px rgba(92, 107, 192, 0.5);
}

/* Search icon button */
.search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0; /* Remove padding from the button */
}

.search-icon i {
    font-size: 1.2em;
    color: #666;
    transition: color 0.3s;
}

.search-icon:hover i {
    color: #333;
}

/* Genres Section */
.music-grid-genres {
    max-width: 100%;
}

.music-grid-genres h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.music-grid-genre-grid {
    display: grid;
    gap: 20px;
    padding: 10px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    justify-content: center;
    width: fit-content;
    margin: 0 auto;
}

.music-grid-genre-card {
    display: flex;
    flex-direction: column;
    text-align: center;
    background-color: #3a3a3a;
    border: 1px solid #555;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.3s ease;
    color: inherit;
    text-decoration: none;
}

.music-grid-genre-card:hover {
    border: 1px solid #b1d698; /* Animate to a green border */
    box-shadow: 0 0 15px rgba(208, 121, 211, 0.8); /* Greenish glow */
    background-color: #4b4b4b;
}

.music-grid-genre-name {
    font-size: 1.1em;
    color: #c0c0c0;
    font-weight: bold;
}


/* Songs Section */
.song-list-section {
    max-width: 100%;
}

.song-list-section h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.music-grid-song-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 10px;
}

.music-grid-song-card {
    background-color: #3a3a3a;
    border: 1px solid #555;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.2s ease, background-color 0.3s ease;
}

.music-grid-song-card:hover {
    border: 1px solid #b1d698; /* Animate to a green border */
    box-shadow: 0 0 15px rgba(208, 121, 211, 0.8); /* Greenish glow */
    background-color: #4b4b4b;
}

.music-grid-thumbnail {
    position: relative;
    cursor: pointer;
}

.music-grid-thumbnail img {
    width: 100%;
    height: auto;
    border-bottom: 1px solid #ddd;
}

.music-grid-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2em;
    color: #ffffff;
    opacity: 0.8;
}

/* Age Box - Positioned at the Bottom-Right */
.music-grid-age {
    font-size: 0.7em;
    color: #c0c0c0;
    position: absolute;
    bottom: -20px;
    right: 0px;
    padding: 1px 5px;
    text-align: center;
    background-color: transparent; /* Default - will be overridden by age-specific colors */
    opacity: 0.8;
}

.music-grid-info {
    margin-top: 5px;
    padding: 10px;
}

.music-grid-title {
    font-size: 1em;
    font-weight: bold;
    margin: 5px 0;
    color: #b8b8b8;
}

.music-grid-genre {
    font-size: 0.9em;
    color: #c0c0c0;
}


/* FSK 0: Gray */
.music-grid-age.age-gray {
    background-color: #888888; /* Light gray */
    color: #000; /* Darker text for contrast */
}

/* FSK 6: Yellow */
.music-grid-age.age-yellow {
    background-color: #c5b349; /* Yellow */
    color: #000; /* Darker text for contrast */
}

/* FSK 12: Green */
.music-grid-age.age-green {
    background-color: #1b701b; /* Green */
    color: #fff; /* Lighter text for contrast */
}


.song-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.song-list-header h2 {
    margin: 0;
    font-size: 1.5em;
}


/* Play all Button */
.play-all-btn {
    background-color: #b1d698;
    color: #2c2d33;
    padding: 8px 16px;
    font-size: 1em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.play-all-btn:hover {
    background-color: #1b701b;
    color: #fff;
}


/* Now Playing Section */
/*--------------------------------------------------------------------------------------*/

.music-grid-now-playing-section {
    overflow: hidden; /* Contain everything within the section */
}

.music-grid-now-playing {
    max-width: 100%;
    text-align: center;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 15px;
    background-color: #3a3a3a;
}

.music-grid-now-playing h2 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #f0f0f0;
}

.thumbnail-zoom-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 56.25%; /* Maintain 16:9 aspect ratio */
    overflow: hidden; /* Contain any overflow */
}

#music-grid-now-playing-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transform-origin: center;
    animation: zoomEffect 15s ease-in-out infinite; /* Smooth zoom */
}

.thumbnail-overlay {
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}


.music-grid-audio-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.music-grid-controls button {
    padding: 10px;
    font-size: 1.2em;
    color: #ffffff;
    background-color: #5c6bc0; /* Updated color to match the "Hören" and "Singen" buttons */
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin: 0 10px; /* Added space between buttons */
}

.music-grid-controls button:hover {
    background-color: #acd68f; /* Slightly darker color on hover */
}

.player-button {
    background-color: #5c6bc0;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
}

.player-button:hover {
    background-color: #3949ab;
}
.music-grid-controls button:active {
    transform: scale(0.95); /* Slight shrink on click */
}

/* Adjust icon sizes in player buttons */
.music-grid-controls i {
    font-size: 1.2em;
}

/* Fullscreen overlay styles */
#fullscreen-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.fullscreen-content {
    position: relative;
    display: flex;
    align-items: center; /* Center vertically */
    gap: 20px; /* Space between image and play/pause button */
}

/* Fullscreen image styles */
.fullscreen-content img {
    max-width: 85vw; /* Larger width for the image */
    max-height: 90vh; /* Max height to occupy more vertical space */
    object-fit: contain;
    border-radius: 8px;
}

/* Close button (X) */
#fullscreen-close {
    position: absolute;
    top: 30px;
    right: 15px;
    font-size: 1.8em;
    color: #fff;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Play/Pause button styles */
#fullscreen-play-pause {
    font-size: 2em;
    color: #5c6bc0; /* Match button color */
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#fullscreen-play-pause:hover {
    background-color: rgba(57, 73, 171, 0.8);
}

/* Ensure overlay closes when clicking outside play/pause button */
.fullscreen-overlay {
    cursor: pointer;
}
.fullscreen-content {
    cursor: auto; /* Allow clicking on content without closing */
}



/* Styling for the lyrics section */
.music-grid-lyrics {
    margin-top: 20px; /* Space above the lyrics section */
    font-size: 1.3em; /* Slightly larger font for lyrics */
    color: #f0f0f0;
}

.music-grid-lyrics h3 {
    margin-bottom: 10px;
    font-size: 1.2em;
    color: #b8e986; /* Matches the color of other section titles */
}

/* Mobile adjustments */
@media (max-width: 768px) {

    .music-grid-layout {
        padding: 0px;
        width: 100%;
      }

    /* Display each section as a separate row */
    .music-grid-layout {
        display: block;
    }

    .search-box-wrapper {
        max-width: 100%; /* Allow the wrapper to use full width on small screens */
        padding: 0 15px; /* Add some padding for alignment */
    }

    #song-search-box {
        font-size: 0.9em; /* Slightly smaller font for mobile */
        padding: 8px 36px 8px 10px; /* Adjust padding for smaller screen sizes */
    }

    .search-icon {
        right: 8px; /* Adjust the icon position for smaller screens */
    }

    .search-icon i {
        font-size: 1em; /* Slightly smaller icon on mobile */
        padding-right: 20px;
    }

    /* Genre Slider Row: Horizontal scrolling */
    .music-grid-genre-grid-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin; /* Firefox */
        padding-bottom: 10px;
    }

    .music-grid-genres {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 10px;
    }

    .music-grid-genre-grid {
        display: flex;
        gap: 10px;
    }
    
    /* Song section scroll */
    .music-grid-song-list-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 10px;
    }

    .music-grid-genre-card {
        flex: 0 0 auto;
        min-width: 100px; /* Adjust as needed */
        cursor: pointer;
        text-align: center;
    }

    /* Song Slider Row: Horizontal scrolling */
    .music-grid-song-list {
        display: flex;
        gap: 10px;
    }

    /* Adjust song card width for mobile */
    .music-grid-song-card {
        flex: 0 0 80%; /* Adjust percentage as needed */
        max-width: 150px;
        margin: 0 1px;
    }


    /* Player Row: Display as a separate block with full width */
    .music-grid-now-playing-section {
        display: block;
        padding-top: 10px;
    }

    .music-grid-now-playing-info,
    .music-grid-lyrics {
        padding: 0 10px;
    }

    .music-grid-audio-container {
        display: flex;
        justify-content: center;
        gap: 5px;
        padding: 10px 0;
    }

    /* Ensure font and spacing adjustments for a better fit on mobile */
    #now-playing-title {
        font-size: 1.2em;
        margin-bottom: 5px;
    }

    #now-playing-lyrics {
        font-size: 1em;
        line-height: 1.4em;
    }
}