/* Music Hub Prototype Styles - YouTube Music / Spotify Vibe */

/* 1. Reset / Base Layout */
.music-hub-container {
    padding-top: 80px;
    /* Space for fixed header */
    padding-bottom: 120px;
    /* Space for Sticky Audio Bar */
    max-width: 1600px;
    margin: 0 auto;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* 2. Hero Section (Featured Track) */
.music-hero {
    position: relative;
    width: 95%;
    margin: 0 auto 50px auto;
    height: 400px;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    background: #111;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.music-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.6;
    transition: opacity 0.5s ease;
}

.music-hero-content {
    position: relative;
    z-index: 10;
    padding: 40px;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 1), transparent);
}

.music-tag {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.music-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.1;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.music-hero p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin-bottom: 25px;
}

.play-hero-btn {
    padding: 15px 40px;
    border-radius: 50px;
    background: var(--accent-red);
    color: white;
    border: none;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(187, 10, 10, 0.4);
}

.play-hero-btn:hover {
    transform: scale(1.05);
    background: #ff1a1a;
}

/* 3. Shelf Section (Horizontal Scroll) */
.music-shelf {
    margin-bottom: 50px;
    padding-left: 2.5%;
    /* Align with Hero */
    transition: all 0.5s ease;
}

.shelf-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    padding-right: 2.5%;
    transition: all 0.3s ease;
}

.shelf-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.shelf-more {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s;
}

.shelf-more:hover {
    color: var(--accent-red);
}

.shelf-scroller {
    display: flex;
    gap: 25px;
    overflow-x: auto;
    overflow-y: hidden;
    /* Prevent vertical scroll within this element */
    padding-bottom: 20px;
    /* Space for scrollbar/shadow */
    padding-right: 40px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    transition: all 0.4s ease;
    -webkit-overflow-scrolling: touch;
    /* Smooth momentum scrolling on iOS */
}

.shelf-scroller::-webkit-scrollbar {
    height: 8px;
}

.shelf-scroller::-webkit-scrollbar-track {
    background: transparent;
}

.shelf-scroller::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* 4. Track Card (Album Art Style) */
.track-card {
    flex: 0 0 220px;
    /* Fixed width */
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.track-card:hover {
    transform: translateY(-5px);
}

.track-art-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    /* Square */
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.track-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.3s ease;
}

.track-card:hover .track-art {
    transform: scale(1.1);
    filter: brightness(0.6);
}

.track-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.track-card:hover .track-overlay {
    opacity: 1;
}

.track-play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent-red);
    color: white;
    border: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.track-card:hover .track-play-btn {
    transform: scale(1);
}

.track-info {
    display: none;
    /* Hide title/date - only show thumbnails */
}

.track-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
}

/* 5. SEARCH SECTION & NO RESULTS */
.music-search-section {
    width: 95%;
    margin: 0 auto 40px auto;
}

.search-wrapper {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.search-input-container {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 12px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.search-input-container:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(187, 10, 10, 0.2);
    transform: translateY(-2px);
}

.search-icon-visual {
    font-size: 1.2rem;
    opacity: 0.6;
}

#videoSearch,
#journeySearch {
    flex: 1;
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    outline: none;
    padding: 5px 0;
}

#videoSearch:focus,
#journeySearch:focus {
    outline: none;
    box-shadow: none;
}

#videoSearch::placeholder,
#journeySearch::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.clear-search-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.clear-search-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* No Results Section */
.no-results-section {
    width: 95%;
    margin: 40px auto;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.no-results-content {
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.no-results-content h3 {
    font-size: 1.8rem;
    margin: 0;
    color: var(--text-primary);
}

.no-results-content p {
    color: var(--text-secondary);
    margin: 0;
}

/* Eyes Animation - Emoji Style 👁️👁️ */
.eyes-animation {
    display: flex;
    gap: 4px;
    /* Eyes are close together in emoji style */
    margin-bottom: 20px;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.5));
}

.eye {
    width: 70px;
    height: 90px;
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    border-radius: 40px;
    /* Capsule shape */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 -5px 10px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: emojiBlink 5s infinite;
}

/* Subtle top highlight for 3D effect */
.eye::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 15px;
    width: 30px;
    height: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    filter: blur(5px);
}

.pupil {
    width: 34px;
    height: 55px;
    /* Dark pupil with purple tint at bottom */
    background: linear-gradient(to bottom, #1a1a1a 70%, #4a2b6e 100%);
    border-radius: 18px;
    position: relative;
    animation: emojiMove 6s infinite ease-in-out;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.4);
}

/* Pupil Shine/Reflection */
.pupil::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

@keyframes emojiMove {

    0%,
    20%,
    100% {
        transform: translate(0, 0);
    }

    /* Look at us */
    30%,
    45% {
        transform: translate(12px, 5px);
    }

    /* Look right + slightly down */
    55%,
    70% {
        transform: translate(-12px, 5px);
    }

    /* Look left + slightly down */
    80%,
    90% {
        transform: translate(0, 0);
    }

    /* Back to center */
}

@keyframes emojiBlink {

    0%,
    82%,
    86%,
    90%,
    100% {
        transform: scaleY(1);
    }

    84%,
    88% {
        transform: scaleY(0.05);
    }

    /* Very thin blink */
}

/* 6. SEARCH GRID VIEW */
.search-active .shelf-scroller {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 30px;
    overflow-x: visible;
    padding-right: 2.5%;
}

.search-active .music-shelf {
    margin-bottom: 40px;
}

.search-active .shelf-header {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

.search-active .shelf-more {
    display: none;
    /* Hide 'View All' during search */
}

/* Horizontal line between shelves in grid view */
.search-active .music-shelf:not(:last-of-type) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 40px;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .music-hub-container {
        padding-top: 100px;
    }

    .music-hero {
        height: 300px;
        margin-bottom: 30px;
    }

    .music-hero h1 {
        font-size: 2rem;
    }

    .track-card {
        flex: 0 0 160px;
    }

    .eye {
        width: 50px;
        height: 65px;
    }

    .pupil {
        width: 25px;
        height: 40px;
    }

    .search-active .shelf-scroller {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 15px;
    }

    /* Limit max size in search grid on mobile */
    .search-active .track-card {
        flex: none;
        max-width: 180px;
    }
}

/* Extra small screens (under 450px) */
@media (max-width: 450px) {
    .search-active .shelf-scroller {
        grid-template-columns: repeat(2, 1fr);
        /* Always 2 columns */
        gap: 12px;
    }

    .search-active .track-card {
        max-width: 100%;
        /* Fill the column but grid controls size */
    }
}