/* 
   Ouvir Música - Unique Pro Design 
   Concept: Modern Light Streaming Interface
*/

:root {
    /* --- Palette --- */
    --bg-body: #f9fafb;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f3f4f6;
    --bg-subtle: #f9fafb;

    --text-main: #111827;
    --text-muted: #6b7280;
    --text-light: #9ca3af;

    --primary: #e11d48;
    /* Brand Red */
    --primary-hover: #be123c;
    --primary-light: #ffe4e6;

    --border: #e5e7eb;
    --border-subtle: #f1f1f1;
    /* Added for subtler separators */


    /* --- Metrics --- */
    --container-width: 1200px;
    --header-height: 70px;
    --player-height: 80px;
    --radius-card: 12px;
    --radius-btn: 99px;

    /* --- Effects --- */
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --glass: rgba(255, 255, 255, 0.9);
    --backdrop-blur: blur(12px);

    --bg-player: #ffffff;
}

/* Dark Theme Overrides */
body.dark-theme,
html.dark-theme body {
    /* Palette - Dark */
    --bg-body: #0f1014;
    --bg-surface: #18191f;
    --bg-surface-hover: #22232a;
    --bg-subtle: #121318;

    --bg-player: #18191f;

    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-light: #6b7280;

    --border: #2a2b32;
    --border-subtle: #222329;

    --glass: rgba(24, 25, 31, 0.9);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* --- Reset & Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: var(--player-height);
    /* Space for player */
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Components --- */

/* 1. Header Navigation */
.site-header {
    height: var(--header-height);
    background: var(--glass);
    backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.nav-menu {
    display: flex;
    gap: 24px;
}

.nav-link {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-muted);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-main);
}

/* Search with modern feel */
.search-wrapper {
    position: relative;
    width: 300px;
}

.search-input {
    width: 100%;
    background: var(--bg-subtle);
    border: 1px solid var(--bg-subtle);
    /* Invisible border initially */
    border-radius: var(--radius-btn);
    padding: 10px 16px 10px 40px;
    font-size: 14px;
    color: var(--text-main);
    transition: all 0.2s;
}

.search-input:focus {
    background: var(--bg-surface);
    border-color: var(--border);
    box-shadow: 0 0 0 2px var(--primary-light);
    outline: none;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 14px;
}

/* 2. Hero Section (Home/Genre) */
.hero-section {
    padding: 40px 0;
    display: flex;
    align-items: center;
    gap: 32px;
}

.hero-image {
    width: 220px;
    height: 220px;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-hover);
    object-fit: cover;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 12px;
}

.hero-meta {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
}

/* 3. Section Titles */
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: end;
}

.view-all {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-all:hover {
    color: var(--primary);
}

/* 4. Cards (Artists/Albums) - The "Spotify" Grid Feel */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.grid-cards-dense {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    /* Smaller min-width for 3+ cols */
    gap: 16px;
    /* Tighter gap */
}

/* 4b. Artist List View (Horizontal - Small Icon) */
.artist-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    /* Approx 3 columns */
    gap: 20px;
}

.artist-list-grid .media-card {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 16px;
    padding: 10px;
    background: var(--bg-surface);
    /* Optional: distinct background */
    border: 1px solid transparent;
}

.artist-list-grid .media-card:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border);
}

.artist-list-grid .media-cover {
    width: 60px !important;
    height: 60px !important;
    flex-shrink: 0;
    margin-bottom: 0 !important;
    border-radius: 8px;
    /* Rounded square icon */
}

/* ... existing play-btn-overlay rules ... */
.artist-list-grid .play-btn-overlay {
    width: 30px;
    height: 30px;
    font-size: 12px;
    right: 50%;
    bottom: 50%;
    transform: translate(50%, 50%) scale(0.8);
    opacity: 0;
}

.artist-list-grid .media-card:hover .play-btn-overlay {
    opacity: 1;
    transform: translate(50%, 50%) scale(1);
}

.artist-list-grid .media-info {
    text-align: left;
    min-width: 0;
    /* Important for flex child truncation */
    flex: 1;
}

.grid-cards-dense .media-title {
    font-size: 13px;
    /* Slightly smaller text */
}

.grid-cards-dense .media-subtitle {
    font-size: 11px;
}

.media-card {
    background: transparent;
    border-radius: var(--radius-card);
    padding: 12px;
    transition: background 0.2s;
    position: relative;
    cursor: pointer;
}

.media-card:hover {
    background: var(--bg-surface-hover);
}

.media-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 8px;
    /* Slightly less than card */
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: var(--shadow-card);
}

.media-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.media-card:hover .media-cover img {
    transform: scale(1.05);
}

/* Floating Play Button on Hover */
.play-btn-overlay {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.4);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-card:hover .play-btn-overlay {
    opacity: 1;
    transform: translateY(0);
}

.play-btn-overlay:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.media-info {
    padding: 0 4px;
}

.media-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.media-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* 5. Track Lists */
.track-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Small gap between rows */
}

/* Sidebar/Widget Track Item (Simple Version) */
.track-sidebar-item {
    display: grid;
    grid-template-columns: auto 1fr 40px;
    /* Thumb Title Icon */
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-muted);
    transition: background 0.2s, color 0.2s;
}

.track-sidebar-item:hover {
    background: var(--bg-surface-hover);
    color: var(--text-main);
}

.track-sidebar-item img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin-right: 12px;
    object-fit: cover;
}

.track-sidebar-item .track-title-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-sidebar-item .fa-play {
    font-size: 12px;
    color: var(--text-muted);
    justify-self: center;
}

/* 6. Player Bar (Fixed Bottom) */
#audio-player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--player-height);
    background: var(--bg-player);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.02);
}

.player-left {
    display: flex;
    align-items: center;
    width: 30%;
    gap: 16px;
}

.p-thumb {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    background: #eee;
    object-fit: cover;
}

.p-info h4 {
    font-size: 14px;
    margin-bottom: 2px;
}

.p-info span {
    font-size: 12px;
    color: var(--text-muted);
}

.player-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 600px;
}

.p-controls {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 18px;
    color: var(--text-main);
}

#btn-prev,
#btn-next {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 50%;
}

#btn-prev:hover,
#btn-next:hover {
    color: var(--primary);
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.05);
    /* Very subtle background */
}

.btn-main-play {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn-main-play:hover {
    transform: scale(1.05);
    border-color: var(--primary);
    color: var(--primary);
}

/* =========================================
   TRACK LAYOUTS (Artist & Album Pages)
   ========================================= */

/* Artist Page: Track Grid Layout - Uses Unified Grid defined below */
/* Variant for Artist Page (No Artist Column) */
.track-grid-layout.artist-view {
    grid-template-columns: 40px auto 170px !important;
}

/* Album Page: Track Grid Layout - Defined in album.css */
/* Kept empty here to avoid confusion, or handled by album.css */

.track-grid-layout:hover {
    background: var(--bg-surface-hover);
}

.track-info-col {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.track-info-col img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.track-artist-col {
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-meta-col {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    /* Increased separation */
}

.btn-lyrics-small {
    font-size: 12px;
    /* Increased size (was 10px) */
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-lyrics-small:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.progress-bg {
    flex: 1;
    height: 4px;
    background: var(--bg-surface-hover);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.progress-fill {
    background: var(--primary);
    height: 100%;
    border-radius: 2px;
    width: 0%;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: -4px;
    top: -3px;
    width: 10px;
    height: 10px;
    background: white;
    border: 2px solid var(--primary);
    border-radius: 50%;
    opacity: 0;
    /* Show on hover maybe? */
}

.progress-bg:hover .progress-fill::after {
    opacity: 1;
}

/* 7. Buttons */
.btn-pill {
    padding: 8px 24px;
    border-radius: 99px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--text-main);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
    }

    .grid-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .track-row {
        grid-template-columns: 30px auto 50px;
    }

    /* Hide Artist column on mobile? */
    .player-left {
        display: none;
    }

    /* Hide info on super small screens? */
    .p-info {
        display: none;
    }

    .header-inner {
        flex-direction: column;
        gap: 12px;
        height: auto;
        padding: 12px;
    }

    .site-header {
        height: auto;
        position: relative;
    }
}

/* =========================================
   FOOTER STYLES
   ========================================= */
.site-footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 80px 0 40px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 16px;
    line-height: 1.6;
    max-width: 300px;
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
    color: var(--text-main);
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: var(--primary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 40px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-light);
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 18px;
    transition: color 0.2s;
}

.social-links a:hover {
    color: var(--text-main);
}

/* --- Custom Scrollbar (Celeste/Modern) --- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
    background-color: #00bcd4;
    /* Celeste/Cyan */
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #0097a7;
    border-width: 1px;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* Genre Cards Tweaks */
.genre-card {
    transition: transform 0.2s;
    border: none !important;
}

.genre-card:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* =========================================
   PAGE SPECIFIC STYLES
   ========================================= */

/* Genres Page (generos.php) */
.genre-header {
    position: relative;
    min-height: 350px;
    /* Changed from fixed height */
    padding: 60px 20px;
    /* Added padding for auto height */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
    width: 100%;
    margin: 0;
    border-radius: 0;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.genre-desc-container {
    font-size: 18px;
    max-width: 1200px;
    /* Increased from 700px */
    width: 90%;
    /* Responsive width */
    margin: 0 auto;
    opacity: 0.95;
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.genre-desc-container p {
    margin-bottom: 12px;
}

.genre-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    filter: brightness(0.4);
}

.genre-content {
    position: relative;
    z-index: 2;
}

.genre-title {
    font-size: 56px;
    font-weight: 900;
    letter-spacing: -2px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.genre-pill {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    font-weight: 600;
    margin: 8px;
    color: var(--text-main);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.genre-pill:hover {
    background: white;
    color: black;
}

/* Song Page (cancion.php) */
.song-hero {
    display: flex;
    align-items: center;
    gap: 40px;
    /* padding: 60px 0; */
}

.song-cover-large {
    width: 300px;
    height: 300px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    object-fit: cover;
}

.lyrics-container {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-main);
    white-space: pre-wrap;
    font-weight: 500;
    text-align: center;
    background: var(--bg-surface-hover);
    border-radius: 10px;
}

.romanization {
    display: block;
    position: relative;
}

.sidebar h3 {
    font-size: 18px;
    margin-bottom: 16px;
    font-weight: 700;
}

.content-split {
    display: flex;
    gap: 60px;
    padding-bottom: 100px;
}

@media(max-width: 768px) {
    .song-hero {
        flex-direction: column;
        text-align: center;
    }

    .content-split {
        flex-direction: column;
    }
}

/* Legal Page (legal.php) */
.legal-content {
    max-width: 800px;
    margin: 60px auto;
    padding: 0 20px;
    line-height: 1.8;
    color: var(--text-main);
}

.legal-content h1 {
    font-size: 36px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}

.legal-content h2 {
    font-size: 20px;
    margin-top: 40px;
    margin-bottom: 16px;
    color: var(--primary);
}

.legal-content p {
    margin-bottom: 16px;
    font-size: 16px;
    color: var(--text-secondary);
}

/* Robust Player Details */
#p-thumb,
.p-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    background: #222;
}

#yt-player-container {
    pointer-events: none;
    opacity: 0;
    position: absolute;
    top: -9999px;
}

/* Robust Player Styles */
#p-thumb,
.p-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    background: #222;
}

#yt-player-container {
    pointer-events: none;
    opacity: 0;
}

/* Active Track */
.active-track {
    background-color: var(--bg-surface-hover) !important;
    border-left: 3px solid var(--primary);
}

.active-track .track-num {
    color: var(--primary) !important;
    font-weight: 700;
}

.active-track .track-title-text {
    color: var(--primary);
}

.track-num-wrap {
    align-items: center !important;
    justify-content: center !important;
}

/* Video Floating Player (Refactored) */
#yt-player-container {
    position: absolute;
    top: -9999px;
    /* Default Hidden */
    left: -9999px;
    width: 320px;
    height: 180px;
    background: black;
    z-index: 10000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.8) translateY(20px);
}

#yt-player-container.video-open {
    top: auto;
    left: auto;
    bottom: 110px;
    right: 20px;
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
}

#yt-player {
    width: 100%;
    height: 100%;
}

.btn-close-floating {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border: 2px solid #121212;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.btn-close-floating:hover {
    transform: scale(1.1);
}

#btn-toggle-video:hover {
    color: var(--primary) !important;
}

#btn-toggle-video.active {
    color: var(--primary) !important;
    text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.5);
}

/* =========================================
   TRACK LIST STANDARDIZATION (Unified Grid)
   ========================================= */

/* The strict 4. Track Grid Layout (Strict Project-Wide) */
.track-grid-layout {
    display: grid !important;
    grid-template-columns: 40px auto 250px 170px !important;
    /* Increased last col for "Ver Letra" */
    gap: 15px;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
}

.track-grid-layout:hover {
    background: var(--bg-surface-hover);
}

/* Column 1: Number & Play Icon Wrapper */
.track-num-wrap {
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
    width: 100%;
}

/* DEFAULT STATE: Show numbers, hide play icons */
.track-num,
.track-number {
    display: inline-block;
}

.track-play-mini,
.track-play-icon {
    display: none;
    color: var(--primary);
    font-size: 14px;
}

/* For artist page (absolute positioning) */
.track-play-mini {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* HOVER STATE: Show play icon, hide number */
.track-grid-layout:hover .track-num,
.track-grid-layout:hover .track-number,
.album-track:hover .track-num,
.album-track:hover .track-number {
    display: none;
}

.track-grid-layout:hover .track-play-mini,
.track-grid-layout:hover .track-play-icon,
.album-track:hover .track-play-mini,
.album-track:hover .track-play-icon {
    display: inline-block;
}

/* Column 2: Info (Image + Title) */
.track-info-col {
    display: flex;
    align-items: center;
    gap: 12px;
}

.track-info-col img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

/* Column 3: Artist */
.track-artist-col {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-artist-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
}

.track-artist-link:hover {
    text-decoration: underline;
}

/* Column 4: Meta */
.track-meta-col {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* ACTIVE TRACK STATE (Legacy & Grid Support) */
.track-grid-layout.active-track,
.album-track.active-track {
    background: var(--bg-surface-hover);
    border-left: 4px solid var(--primary);
    border-radius: 4px;
}

/* ACTIVE: Hide number text ONLY, show play icon */
/* Safety fix: Ensure CONTAINER .track-num is visible */
.track-grid-layout.active-track .track-num,
.album-track.active-track .track-num {
    display: none;
    /* Force container visibility */
}

/* Hide the SPAN inside */
.track-grid-layout.active-track .track-number,
.album-track.active-track .track-number {
    display: none;
}

.track-grid-layout.active-track .track-play-mini,
.track-grid-layout.active-track .track-play-icon,
.album-track.active-track .track-play-mini,
.album-track.active-track .track-play-icon {
    display: inline-block;
    color: var(--primary);
}

/* Played Track State (Already listened) */
.track-grid-layout.played-track .track-num {
    color: var(--text-light);
    opacity: 0.6;
}

.track-grid-layout.played-track .track-title-text {
    color: var(--text-muted);
}

/* =========================================
   PAGE LAYOUT UTILITIES
   ========================================= */

.content-split {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

@media (max-width: 900px) {
    .content-split {
        flex-direction: column;
    }
}

/* Sidebar Track Item */
.track-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-subtle);
    text-decoration: none;
    transition: background 0.2s;
    border-radius: 8px;
}

.track-sidebar-item:last-child {
    border-bottom: none;
}

.track-sidebar-item:hover {
    background: var(--bg-surface-hover);
}

.track-sidebar-item img {
    width: 45px;
    height: 45px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.track-sidebar-item .track-title-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.track-sidebar-item i {
    color: var(--primary);
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.2s;
}

.track-sidebar-item:hover i {
    opacity: 1;
    transform: translateX(0);
}

/* =========================================
   ALBUM LIST VIEW STYLES (Migrated from albums.php)
   ========================================= */
.list-mode .media-card {
    display: none;
}

.list-mode {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.album-list-item {
    display: none;
}

.list-mode .album-list-item {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--bg-surface);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}

.album-list-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.album-list-cover {
    width: 160px;
    height: 160px;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: var(--shadow-card);
    object-fit: cover;
}

.album-list-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.album-list-type {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.album-list-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.album-list-meta {
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 4px;
}

.album-list-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.btn-play-album {
    background: #22c55e;
    color: black;
    border: none;
    padding: 10px 24px;
    border-radius: 99px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-play-album:hover {
    transform: scale(1.05);
    background: #1fde68;
}

.btn-icon-action {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-action:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

/* =========================================
   SAFETY RESTORE: GENERIC TRACK LISTS
   (Ensures sidebar and other lists remain visible)
   ========================================= */
.track-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.track-sidebar-item {
    display: flex !important;
    /* Force visibility */
}

/* =========================================
   SCOPED ALBUM LIST VIEW (Strict Isolation)
   ========================================= */

.album-tracks-list {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
}

/* 1. LAYOUT: Force Grid on Album Tracks */
.track-row.album-track {
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr) auto 60px !important;
    padding: 10px 12px;
    border-radius: 6px;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-muted);
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid transparent;
}

.track-row.album-track:hover {
    background: var(--bg-surface-hover);
}

/* 2. COLORS: Active (Red) & Hover (Green) */

/* Active */
.track-row.album-track.active-track {
    background: rgba(var(--primary-rgb), 0.1);
    border-left: 3px solid var(--primary);
}

.track-row.album-track.active-track .track-title {
    color: var(--primary) !important;
    font-weight: 700;
}

.track-row.album-track.active-track .track-play-icon {
    color: var(--primary) !important;
}

/* 3. INTERACTION LOGIC: Swap Number <-> Icon */

.track-row.album-track:hover .track-num,
.track-row.album-track.active-track .track-num {
    display: flex !important;
}

/* Centering for column 1 */
.track-row.album-track .track-num {
    font-size: 14px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Default State */
.track-row.album-track .track-number {
    display: block;
}

.track-row.album-track .track-play-icon {
    display: none !important;
}

/* Hover & Active State: Swap Visibilities */
.track-row.album-track:hover .track-number,
.track-row.album-track.active-track .track-number {
    display: none !important;
}

.track-row.album-track:hover .track-play-icon,
.track-row.album-track.active-track .track-play-icon {
    display: inline-block !important;
}


/* 4. TITLE TRUNCATION HANDLING */
.album-track .track-title {
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 15px;
    min-width: 0;
    width: 100%;
    display: block;
}

.track-dur {
    font-size: 13px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* SHARE DROPDOWN MENU */
.share-container {
    position: relative;
    display: inline-block;
}

.share-menu {
    position: absolute;
    top: 110%;
    /* Just below the button */
    left: 0;
    width: max-content;
    min-width: 160px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: none;
    /* Hidden by default */
    flex-direction: column;
    gap: 4px;
    z-index: 100;
}

/* Modifier to open upwards if near bottom (optional, but good for footers) */
.share-menu.up {
    top: auto;
    bottom: 110%;
}

.share-menu.show {
    display: flex;
    animation: fadeIn 0.1s ease-out;
}

.share-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.share-item:hover {
    background: var(--bg-surface-hover);
}

.share-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}