:root { 
    --header-h: 60px; 
    --video-w: 500px; 
    --accent: #ff2f56; 
}

html, body { 
    margin: 0; 
    padding: 0; 
    height: 100%; 
    background: #000; 
    color: #fff; 
    font-family: Arial, sans-serif; 
    overflow: hidden; 
}

/* =========================
   HEADER & NAVIGATION
========================= */
header { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: var(--header-h); 
    background: #000; 
    z-index: 1000; 
    border-bottom: 1px solid #222; 
    display: flex; 
    justify-content: center; 
}

.header-inner { 
    width: 100%; 
    max-width: 560px; 
    height: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 0 12px; 
    box-sizing: border-box; 
}

.logoText { 
    font-family: Arial, sans-serif; 
    font-weight: 900; 
    font-size: 22px; 
    cursor: pointer; 
    color: #fff; 
}

header .logoText span { 
    color: #ff2f56; 
    text-shadow: 0 0 14px rgba(255,47,86,0.65); 
}

.icon-btn { 
    background: none; 
    border: none; 
    cursor: pointer; 
    padding: 6px; 
    display: flex; 
    align-items: center; 
}

.icon-btn svg { 
    width: 28px; 
    height: 28px; 
    fill: #fff; 
}

#speakerIcon { 
    width: 40px; 
    height: 40px; 
}

@keyframes wavePulse {
    0% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0.4; transform: scale(0.9); }
}

#speakerWaves {
    transform-origin: center;
}

.is-playing #speakerWaves {
    animation: wavePulse 1.5s infinite ease-in-out;
}

#soundToggle.is-playing #speakerIcon path {
    fill: var(--accent);
}

#soundToggle {
    transition: transform 0.2s;
}

#soundToggle:active {
    transform: scale(0.9);
}

.header-right { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.login-link { 
    color: #fff; 
    text-decoration: none; 
    font-size: 13px; 
    font-weight: bold; 
    border: 1px solid #444; 
    padding: 4px 12px; 
    border-radius: 4px; 
}

.user-avatar { 
    width: 34px; 
    height: 34px; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 2px solid #333; 
    cursor: pointer; 
}

/* =========================
   FEED & ITEMS
========================= */
.feed { 
    margin-top: var(--header-h); 
    height: calc(100vh - var(--header-h)); 
    overflow-y: scroll; 
    scroll-snap-type: y mandatory; 
    scrollbar-width: none; 
}

.feed::-webkit-scrollbar { 
    display: none; 
}

.item { 
    height: calc(100vh - var(--header-h)); 
    width: 100%; 
    scroll-snap-align: start; 
    scroll-snap-stop: always; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative; 
}

.media-container { 
    width: min(100%, var(--video-w)); 
    height: 100%; 
    position: relative; 
    background: #000; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

/* =========================
   AUDIO PLAYER STYLING
========================= */
.audio-player {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
}

.album-art {
    width: 200px;
    height: 220px;
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
    border-radius: 20px;
    margin-bottom: 30px;
    border: 2px solid #333;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    cursor: pointer;
    transition: box-shadow 0.3s ease;
}

.album-art.playing {
    box-shadow: 0 0 30px var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 20px var(--accent); }
    50% { box-shadow: 0 0 40px var(--accent); }
    100% { box-shadow: 0 0 20px var(--accent); }
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
    padding: 0 20px;
    color: #fff;
}

.track-meta {
    font-size: 14px;
    color: #aaa;
    font-weight: normal;
    margin-top: 4px;
}

.audio-slider-container {
    width: 80%;
    max-width: 300px;
    margin: 20px auto 10px;
    text-align: center;
}

.audio-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #fff;
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

.audio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #000;
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid #fff;
}

.time-display {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #fff;
}

/* =========================
   SIDEBAR & SEARCH (FIXED)
========================= */
.sidebar { 
    position: absolute; 
    right: 15px; 
    top: 38%; 
    transform: translateY(-50%);
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 15px; 
    z-index: 100; 
}

.action { 
    text-align: center; 
    cursor: pointer; 
    user-select: none;
}

.icon-circle { 
    width: 44px; 
    height: 44px; 
    background: rgba(255,255,255,0.12); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    backdrop-filter: blur(10px); 
    margin-bottom: 3px; 
    border: 1px solid rgba(255,255,255,0.10); 
}

.action svg { 
    width: 24px; 
    height: 24px; 
    fill: #fff; 
}

.action span { 
    font-size: 11px; 
    font-weight: bold; 
}

/* THE FIX: SEARCH BOX FLOATING ABOVE */
.search-action {
    position: relative; /* Keep icon in place */
}

.search-input-wrapper {
    position: absolute; /* Take it out of the flex flow */
    right: 55px; /* Offset to the left of the glass icon */
    top: 0;
    width: 0;
    height: 44px;
    overflow: hidden;
    transition: width 0.3s ease, opacity 0.2s;
    background: rgba(20, 20, 20, 0.95);
    border-radius: 22px;
    opacity: 0;
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 200;
}

.search-action.active .search-input-wrapper {
    width: 250px; /* Adjust this to how long you want it to glide */
    opacity: 1;
    pointer-events: auto;
    border: 1px solid var(--accent);
    box-shadow: 0 0 15px rgba(255,47,86,0.3);
}

.sidebar-search-input {
    background: transparent;
    border: none;
    color: white;
    padding: 0 20px;
    width: 100%;
    outline: none;
    font-size: 14px;
}

/* =========================
   GENRE MENU & OVERLAYS
========================= */
#globalMenu {
    position: fixed; 
    top: 70px; 
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 380px;
    background: rgba(20,20,20,0.98);
    border: 1px solid #333;
    border-radius: 16px;
    display: none;
    flex-direction: column;
    z-index: 5000;
    max-height: 80vh;
    overflow-y: auto;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
}

#globalMenu button {
    background: none; 
    border: none; 
    color: #fff;
    padding: 16px 20px; 
    text-align: left; 
    cursor: pointer;
    border-bottom: 1px solid #222; 
    font-size: 15px;
}

#globalMenu button:hover { 
    background: rgba(255,47,86,0.15); 
    color: var(--accent);
}

/* =========================
   COMMENTS & HEARTS
========================= */
#overlay { 
    position: fixed; 
    top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.70); 
    z-index: 1500; 
    display: none; 
}

#commentPanel { 
    position: fixed; 
    bottom: -70%; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 100%; 
    max-width: var(--video-w); 
    height: 70%; 
    background: #121212; 
    z-index: 2000; 
    border-radius: 20px 20px 0 0; 
    transition: bottom 0.3s ease-out; 
    padding: 20px; 
    box-sizing: border-box; 
    display: flex; 
    flex-direction: column; 
    border: 1px solid #333; 
}

#commentPanel.open { bottom: 0; }

.floating-heart {
    position: absolute;
    color: #ff2d55;
    pointer-events: none;
    z-index: 1000;
    font-size: 26px;
    animation: floatUp 1s ease-out forwards;
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-100px) scale(1.5); opacity: 0; }
}

@media (max-width: 600px) {
    .sidebar {
        right: 8px;
        gap: 12px;
    }
    .search-action.active .search-input-wrapper {
        width: 180px;
    }
}

/* MOBILE HEADER FIX */
@media (max-width:600px){

.logoText img{
height:16px;
width:125px;
}

.login-link{
display:none;
}

.user-avatar{
width:26px;
height:26px;
}

.icon-btn svg{
width:24px;
height:24px;
}

}