/* ========================================
   VivoMusic - Song Page CSS
   Complete & Clean
   ======================================== */

/* ============ PAGE LAYOUT ============ */
.song-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 120px;
}

/* ============ HERO SECTION ============ */
.song-hero {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
    background: rgba(10, 20, 10, 0.5);
    border: 1px solid rgba(34, 197, 94, 0.1);
    border-radius: 20px;
    padding: 2rem;
}

.song-hero-cover {
    width: 220px;
    height: 220px;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(34, 197, 94, 0.15);
    flex-shrink: 0;
}

.song-hero-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: all 0.5s ease;
}

.song-hero-cover img.playing {
    animation: coverPulse 2s ease-in-out infinite;
}

@keyframes coverPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(34, 197, 94, 0.2); }
    50% { box-shadow: 0 0 60px rgba(34, 197, 94, 0.5); }
}

.song-hero-cover-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a2a1a, #166534, #0a2a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
}

.song-hero-info {
    flex: 1;
    min-width: 0;
}

.song-hero-genre {
    display: inline-block;
    padding: 0.25rem 1rem;
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
}

.song-hero-title {
    font-size: 2rem;
    color: #fff;
    font-weight: 800;
    margin-bottom: 0.3rem;
    line-height: 1.3;
    word-break: break-word;
}

.song-hero-artist {
    color: #86efac;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.song-hero-album {
    color: #86efac;
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 0.8rem;
}

.song-hero-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: #86efac;
    font-size: 0.85rem;
}

.song-hero-stats span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* ============ PLAYER SECTION ============ */
.player-wrapper {
    background: linear-gradient(145deg, rgba(10, 25, 15, 0.85), rgba(5, 15, 10, 0.95));
    border: 2px solid rgba(34, 197, 94, 0.12);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Visualizer */
.visualizer {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 45px;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.visualizer .bar {
    width: 4px;
    border-radius: 2px;
    background: linear-gradient(to top, #22c55e, #4ade80, #86efac);
    transition: height 0.15s ease;
    opacity: 0.5;
}

.visualizer.active .bar {
    animation: vizBounce 0.4s ease-in-out infinite alternate;
}

.visualizer .bar:nth-child(1){animation-delay:0s}
.visualizer .bar:nth-child(2){animation-delay:0.08s}
.visualizer .bar:nth-child(3){animation-delay:0.16s}
.visualizer .bar:nth-child(4){animation-delay:0.24s}
.visualizer .bar:nth-child(5){animation-delay:0.32s}
.visualizer .bar:nth-child(6){animation-delay:0.4s}
.visualizer .bar:nth-child(7){animation-delay:0.48s}
.visualizer .bar:nth-child(8){animation-delay:0.56s}
.visualizer .bar:nth-child(9){animation-delay:0.64s}
.visualizer .bar:nth-child(10){animation-delay:0.72s}
.visualizer .bar:nth-child(11){animation-delay:0.8s}
.visualizer .bar:nth-child(12){animation-delay:0.88s}
.visualizer .bar:nth-child(13){animation-delay:0.96s}
.visualizer .bar:nth-child(14){animation-delay:1.04s}
.visualizer .bar:nth-child(15){animation-delay:1.12s}
.visualizer .bar:nth-child(16){animation-delay:1.2s}
.visualizer .bar:nth-child(17){animation-delay:1.28s}
.visualizer .bar:nth-child(18){animation-delay:1.36s}
.visualizer .bar:nth-child(19){animation-delay:1.44s}
.visualizer .bar:nth-child(20){animation-delay:1.52s}

@keyframes vizBounce {
    0% { height: 6px; }
    50% { height: 40px; }
    100% { height: 12px; }
}

/* ============ PROGRESS BAR ============ */
.progress-wrap {
    position: relative;
    margin-bottom: 1rem;
    direction: ltr;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: #1a1a1a;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.progress-buffered {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #3a3a3a;
    border-radius: 4px;
    width: 0;
    z-index: 1;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #4ade80, #86efac);
    border-radius: 4px;
    width: 0;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
    transition: width 0.1s linear;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    border: 3px solid #22c55e;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
    z-index: 3;
    left: 0;
    transition: left 0.1s linear;
}

.time-row {
    display: flex;
    justify-content: space-between;
    color: #86efac;
    font-size: 0.78rem;
    margin-top: 0.5rem;
    direction: ltr;
}

/* ============ CONTROLS ============ */
.controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
}

.ctrl-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #86efac;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
    font-family: 'FarDomrol', sans-serif;
}

.ctrl-btn:hover {
    color: #fff;
    transform: scale(1.15);
}

.ctrl-btn:active {
    transform: scale(0.95);
}

.ctrl-btn-sm {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
}

/* Skip buttons */
.ctrl-btn-skip {
    width: 44px;
    height: 44px;
    color: #fff !important;
    font-size: 0.85rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    letter-spacing: 1px;
}

.ctrl-btn-skip:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Play button */
.ctrl-btn-play {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #166534, #22c55e);
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 10px 40px rgba(34, 197, 94, 0.35), 0 0 0 6px rgba(34, 197, 94, 0.08);
    font-size: 1.8rem;
}

.ctrl-btn-play:hover {
    box-shadow: 0 14px 50px rgba(34, 197, 94, 0.5), 0 0 0 12px rgba(34, 197, 94, 0.12);
    transform: scale(1.08);
}

.ctrl-btn-play.playing {
    animation: playGlow 2s ease-in-out infinite;
}

@keyframes playGlow {
    0%, 100% { box-shadow: 0 10px 40px rgba(34, 197, 94, 0.35), 0 0 0 6px rgba(34, 197, 94, 0.08); }
    50% { box-shadow: 0 10px 60px rgba(34, 197, 94, 0.6), 0 0 0 16px rgba(34, 197, 94, 0.15); }
}

/* Volume */
.vol-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    direction: ltr;
}

.vol-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid #fff;
    cursor: pointer;
}

/* ============ ACTION BUTTONS ============ */
.actions-row {
    display: flex;
    gap: 0.8rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    font-size: 0.85rem;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    font-family: 'FarDomrol', sans-serif;
    text-decoration: none;
}

.action-btn-like {
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.action-btn-like:hover { background: rgba(239, 68, 68, 0.15); }
.action-btn-like.liked { background: rgba(239, 68, 68, 0.2); border-color: #ef4444; color: #ef4444; }

.action-btn-playlist {
    background: rgba(234, 179, 8, 0.08);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.2);
}
.action-btn-playlist:hover { background: rgba(234, 179, 8, 0.15); }

.action-btn-download {
    background: rgba(59, 130, 246, 0.08);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.action-btn-download:hover { background: rgba(59, 130, 246, 0.15); }

.action-btn-share {
    background: rgba(139, 92, 246, 0.08);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.2);
}
.action-btn-share:hover { background: rgba(139, 92, 246, 0.15); }

/* Playlist dropdown */
.pl-dropdown { position: relative; }
.pl-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 20, 10, 0.98);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    padding: 0.5rem;
    min-width: 220px;
    display: none;
    z-index: 50;
    margin-bottom: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.pl-menu.show { display: block; }
.pl-menu a {
    display: block;
    padding: 0.5rem 0.8rem;
    color: #86efac;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.8rem;
    transition: all 0.2s;
}
.pl-menu a:hover { background: rgba(34, 197, 94, 0.1); color: #fff; }

/* Login required */
.login-req {
    text-align: center;
    padding: 1rem;
    color: #f87171;
    font-size: 0.82rem;
}
.login-req a { color: #22c55e; }

/* ============ TAGS ============ */
.tags-section { margin: 1.5rem 0; }
.tags-section h3 {
    color: #86efac;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tag-pill {
    padding: 0.35rem 0.9rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    font-size: 0.78rem;
    color: #86efac;
    transition: all 0.3s;
}
.tag-pill:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

/* ============ EXTERNAL LINKS ============ */
.external-links {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.ext-link {
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.82rem;
    transition: all 0.3s;
}
.ext-link:hover { transform: translateY(-2px); }
.ext-link-yt { background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }
.ext-link-sp { background: rgba(34, 197, 94, 0.1); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.2); }
.ext-link-sc { background: rgba(249, 115, 22, 0.1); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.2); }

/* ============ RELATED SONGS ============ */
.related-section {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background: rgba(10, 20, 10, 0.3);
    border: 1px solid rgba(34, 197, 94, 0.08);
    border-radius: 20px;
}

.related-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.related-title {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.related-title-line {
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    border-radius: 2px;
    margin-top: 0.3rem;
}

.related-view-all {
    color: #86efac;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 20px;
    transition: all 0.3s;
}
.related-view-all:hover { background: rgba(34, 197, 94, 0.1); color: #4ade80; border-color: #22c55e; }

/* Grid */
.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* Card */
.related-card {
    background: rgba(10, 20, 10, 0.5);
    border: 1px solid rgba(34, 197, 94, 0.06);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
}
.related-card:hover {
    border-color: rgba(34, 197, 94, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(34, 197, 94, 0.08);
}

/* Cover */
.related-card-cover-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: linear-gradient(135deg, #0a1a10, #0d2d1a, #0a1a10);
}
.related-card-cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}
.related-card:hover .related-card-cover-wrap img { transform: scale(1.08); }

.related-card-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a1a10, #166534, #0a1a10);
    font-size: 2.5rem;
}

/* Play overlay */
.related-card-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.related-card:hover .related-card-play-overlay { opacity: 1; }

.related-card-play-icon {
    width: 0;
    height: 0;
    border-left: 28px solid #fff;
    border-top: 18px solid transparent;
    border-bottom: 18px solid transparent;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
    transform: translateX(3px);
}

/* Badge */
.related-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    color: #4ade80;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border: 1px solid rgba(34, 197, 94, 0.2);
    z-index: 2;
}

/* Info */
.related-card-info {
    padding: 0.7rem 0.8rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.related-card-title {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.15rem;
}

.related-card-artist {
    color: #86efac;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.3rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.related-card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.65rem;
    color: #86efac;
}

/* ============ LYRICS ============ */
.lyrics-section {
    background: rgba(10, 20, 10, 0.4);
    border: 1px solid rgba(34, 197, 94, 0.06);
    border-radius: 18px;
    padding: 2rem;
    margin-top: 2rem;
    white-space: pre-line;
    color: #86efac;
    line-height: 2.2;
    font-size: 0.9rem;
}
.lyrics-section h3 {
    color: #22c55e;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-align: center;
}

/* ============ MINI PLAYER ============ */
.mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: linear-gradient(180deg, rgba(5, 12, 8, 0.98), rgba(2, 8, 4, 0.99));
    border-top: 2px solid rgba(34, 197, 94, 0.2);
    padding: 0.6rem 1.2rem;
    display: none;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}
.mini-player.active { display: flex; }

.mini-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #1a1a1a;
    direction: ltr;
}
.mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    width: 0;
    transition: width 0.1s linear;
}

.mini-cover {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(34, 197, 94, 0.2);
    flex-shrink: 0;
}
.mini-cover-ph {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0a2a1a, #166534);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.mini-info {
    flex: 1;
    min-width: 0;
}
.mini-title {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mini-artist {
    color: #86efac;
    font-size: 0.7rem;
}

.mini-ctrls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.mini-ctrl {
    background: none;
    border: none;
    color: #86efac;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem;
    transition: all 0.2s;
    font-family: 'FarDomrol', sans-serif;
}
.mini-ctrl:hover { color: #fff; }
.mini-ctrl-skip { color: #fff; font-size: 0.65rem; font-weight: 700; }
.mini-ctrl-play {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #166534, #22c55e);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}
.mini-ctrl-close { color: #f87171; }

/* ============ RESPONSIVE - TABLET ============ */
@media (max-width: 1000px) {
    .related-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============ RESPONSIVE - MOBILE ============ */
@media (max-width: 768px) {
    .song-page { padding: 0.8rem 0.8rem 100px; }

    .song-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.2rem;
        gap: 1rem;
    }
    .song-hero-cover { width: 150px; height: 150px; margin: 0 auto; }
    .song-hero-title { font-size: 1.3rem; }
    .song-hero-artist { font-size: 0.9rem; }
    .song-hero-stats { justify-content: center; font-size: 0.75rem; gap: 1rem; }

    .player-wrapper { padding: 1rem; border-radius: 14px; }
    .visualizer { height: 30px; gap: 2px; margin-bottom: 1rem; }
    .visualizer .bar { width: 3px; }

    .controls-row { gap: 1rem; }
    .ctrl-btn-play { width: 60px; height: 60px; font-size: 1.4rem; }
    .ctrl-btn-sm { width: 36px; height: 36px; font-size: 0.9rem; }
    .ctrl-btn-skip { width: 36px; height: 36px; font-size: 0.7rem; }
    .vol-slider { width: 50px; }

    .actions-row { gap: 0.5rem; }
    .action-btn { padding: 0.5rem 1rem; font-size: 0.78rem; }

    .related-section { padding: 1rem; }
    .related-title { font-size: 1.1rem; }
    .related-grid { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
    .related-card-info { padding: 0.6rem; }
    .related-card-title { font-size: 0.73rem; }
    .related-card-artist { font-size: 0.65rem; }

    .mini-player { padding: 0.5rem 0.8rem; gap: 0.6rem; }
    .mini-cover, .mini-cover-ph { width: 34px; height: 34px; }
    .mini-title { font-size: 0.72rem; }
    .mini-artist { font-size: 0.65rem; }

    .tag-pill { font-size: 0.7rem; padding: 0.25rem 0.6rem; }
    .ext-link { font-size: 0.7rem; padding: 0.3rem 0.8rem; }
    .lyrics-section { padding: 1rem; font-size: 0.8rem; }
}

/* ============ RESPONSIVE - SMALL MOBILE ============ */
@media (max-width: 400px) {
    .song-hero-cover { width: 120px; height: 120px; }
    .song-hero-title { font-size: 1.1rem; }
    .controls-row { gap: 0.6rem; }
    .ctrl-btn-play { width: 48px; height: 48px; font-size: 1.1rem; }
    .ctrl-btn-sm { width: 30px; height: 30px; font-size: 0.8rem; }
    .ctrl-btn-skip { width: 30px; height: 30px; font-size: 0.6rem; }
    .vol-slider { width: 35px; }
    .related-grid { gap: 0.5rem; }
}