/* Style system for Elainora - Spotify-themed Premium UI (With Light/Dark Modes & Extensions) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Dark Theme (Default) */
    --bg-black: #000000;
    --bg-dark: #121212;
    --bg-card: #181818;
    --bg-card-hover: #282828;
    --bg-input: #2a2a2a;
    --text-white: #ffffff;
    --text-gray: #a7a7a7;
    --text-muted: #727272;
    --border-color: #2a2a2a;
    --player-bg: #181818;
    
    --primary: #1DB954; /* Spotify green */
    --primary-hover: #1ed760;
    --transition-fast: all 0.2s ease;
    --transition-normal: all 0.3s ease;
    
    /* Neon Pulse Defaults */
    --dominant-cover-rgb: 29, 185, 84;
    --neon-opacity: 0.08;
    --neon-glow: 0px;
    --neon-shadow-opacity: 0;
}

/* Light Theme overrides */
body.light-theme {
    --bg-black: #f0f2f5;
    --bg-dark: #ffffff;
    --bg-card: #f8f9fa;
    --bg-card-hover: #e9ecef;
    --bg-input: #e2e8f0;
    --text-white: #0f172a;
    --text-gray: #475569;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --player-bg: #ffffff;
}

body.light-theme .sidebar-logo, body.light-theme .auth-logo {
    filter: invert(1);
}

body.light-theme .nav-item {
    color: var(--text-gray);
}

body.light-theme .nav-item:hover, body.light-theme .nav-item.active {
    color: var(--text-white);
    background-color: var(--bg-card-hover);
}

body.light-theme .music-card {
    background-color: #e2e8f0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

body.light-theme .music-card:hover {
    background-color: #cbd5e1;
}

body.light-theme .song-row:hover {
    background-color: rgba(15, 23, 42, 0.05);
}

body.light-theme .song-row:hover td {
    color: var(--text-white);
}

body.light-theme .content-panel {
    background: linear-gradient(180deg, #e2e8f0 0%, var(--bg-dark) 250px, var(--bg-dark) 100%);
}

body.light-theme .main-header {
    background-color: rgba(255, 255, 255, 0.8);
}

body.light-theme .search-input {
    background-color: #e2e8f0;
    color: var(--text-white);
}

body.light-theme .modal-card {
    background-color: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

body.light-theme .modal-item {
    background-color: #f1f5f9;
}

body.light-theme .modal-item:hover {
    background-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent; /* Native touch feel without blue highlight */
}

body {
    background-color: var(--bg-black);
    color: var(--text-white);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    user-select: none; /* Native app feel */
    -webkit-user-select: none;
    overscroll-behavior-y: none; /* Disable pull-to-refresh bounce */
}

/* Re-enable selection on input fields */
input {
    user-select: auto;
    -webkit-user-select: auto;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Native tab fade in animation */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================ */
/* SPLASH SCREEN                                */
/* ============================================ */

/* Keyframes */
@keyframes splashLogoEntrance {
    0%   { transform: scale(0.35); opacity: 0; }
    50%  { transform: scale(1.2);  opacity: 1; }
    72%  { transform: scale(0.93); opacity: 1; }
    88%  { transform: scale(1.04); opacity: 1; }
    100% { transform: scale(1.0);  opacity: 1; }
}

@keyframes splashTaglineFade {
    0%   { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes splashGlowPulse {
    0%, 100% { transform: scale(1);   opacity: 0.15; }
    50%       { transform: scale(1.6); opacity: 0;    }
}

/* Splash container */
#splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#splash-screen.hide-splash {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Dark radial gradient background */
.splash-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, #0a2016 0%, #000000 72%);
    z-index: 0;
}

/* Outer glowing ring behind logo */
.splash-bg::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 280px;
    height: 280px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(29, 185, 84, 0.25) 0%, transparent 70%);
    animation: splashGlowPulse 2s ease-in-out 0.3s infinite;
}

/* Logo + tagline container */
.splash-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

/* Logo with entrance animation */
.splash-logo {
    height: 115px;
    object-fit: contain;
    animation: splashLogoEntrance 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
    filter: drop-shadow(0 0 32px rgba(29, 185, 84, 0.6));
}

/* Tagline text */
.splash-tagline {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    animation: splashTaglineFade 0.5s ease 1s both;
}

/* Loading dots below tagline */
.splash-content::after {
    content: '● ● ●';
    font-size: 8px;
    color: rgba(29, 185, 84, 0.5);
    letter-spacing: 6px;
    animation: splashTaglineFade 0.5s ease 1.1s both;
}

/* Auth Pages (Login & Register & Verify) */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top left, #12281a 0%, #000000 80%);
    padding: 20px;
}

.auth-card {
    background-color: var(--bg-dark);
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    border: 1px solid var(--border-color);
    text-align: center;
}

.auth-logo {
    height: 65px;
    margin-bottom: 25px;
    object-fit: contain;
}

.auth-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    color: var(--text-gray);
    font-size: 14px;
    margin-bottom: 30px;
}

.auth-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-white);
}

.form-control {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-white);
    padding: 14px;
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: #727272;
    background-color: #333333;
}

.btn-primary {
    background-color: var(--primary);
    color: #000;
    border: none;
    border-radius: 500px;
    font-size: 15px;
    font-weight: 700;
    padding: 14px;
    width: 100%;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:active {
    transform: scale(0.97); /* Native button click feel */
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: scale(1.02);
}

.auth-footer {
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    font-size: 14px;
    color: var(--text-gray);
}

.auth-link {
    color: var(--text-white);
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.auth-link:hover {
    color: var(--primary);
}

.alert {
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    display: none;
}

.alert-danger {
    background-color: rgba(235, 87, 87, 0.15);
    color: #eb5757;
    border: 1px solid rgba(235, 87, 87, 0.3);
}

.alert-success {
    background-color: rgba(29, 185, 84, 0.15);
    color: var(--primary);
    border: 1px solid rgba(29, 185, 84, 0.3);
}

/* ------------------------------------------ */
/* MAIN DASHBOARD STRUCTURE (Spotify Layout)   */
/* ------------------------------------------ */
.app-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: 1fr;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Navigation */
.sidebar {
    background-color: var(--bg-black);
    padding: 24px 12px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.logo-container {
    padding: 0 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.sidebar-logo {
    height: 70px;
    object-fit: contain;
}

.nav-group {
    background-color: var(--bg-dark);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.nav-item i {
    font-size: 20px;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-white);
}

.library-section {
    flex: 1;
    background-color: var(--bg-dark);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-gray);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 16px;
    padding: 0 4px;
}

.library-header i {
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition-fast);
}

.library-header i:hover {
    color: var(--text-white);
}

.library-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.library-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.library-item:active {
    transform: scale(0.97); /* Native tap feel */
}

.library-item:hover {
    background-color: var(--bg-card-hover);
}

.playlist-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #2e2e2e 0%, #1c1c1c 100%);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: var(--text-gray);
    position: relative;
    overflow: hidden;
}

.playlist-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-avatar.spotify {
    background: linear-gradient(135deg, #1db954 0%, #0d5c29 100%);
    color: #000;
}

.playlist-avatar.youtube {
    background: linear-gradient(135deg, #ff0000 0%, #7c0000 100%);
    color: #fff;
}

.playlist-info {
    flex: 1;
    overflow: hidden;
}

.playlist-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-meta {
    font-size: 12px;
    color: var(--text-gray);
    margin-top: 4px;
}

/* User Account Section inside Sidebar */
.user-widget {
    background-color: var(--bg-dark);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.user-profile-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.user-avatar-container {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--border-color);
}

.user-avatar-container:hover {
    border-color: var(--primary);
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    overflow: hidden;
    flex: 1;
}

.user-email {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

.theme-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.theme-toggle-btn:hover {
    color: var(--text-white);
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-logout:hover {
    color: #eb5757;
}

/* Main Content Panel */
.main-content {
    background-color: var(--bg-black);
    padding: 12px 12px 12px 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-panel {
    background: linear-gradient(180deg, #1e1e1e 0%, var(--bg-dark) 250px, var(--bg-dark) 100%);
    border-radius: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    transition: background var(--transition-normal);
}

/* Main Header */
.main-header {
    height: 64px;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(10px);
}

.mobile-logo-header {
    display: none !important;
}

.search-bar-container {
    flex: 1;
    max-width: 400px;
    position: relative;
    display: none; /* Only visible in Search tab */
}

.search-input {
    width: 100%;
    background-color: #242424;
    border: 1px solid transparent;
    border-radius: 500px;
    padding: 10px 20px 10px 48px;
    color: var(--text-white);
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.search-input:focus {
    border-color: #555;
    background-color: #2a2a2a;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    font-size: 18px;
    pointer-events: none;
}

/* Dynamic Tab Views */
.tab-view {
    display: none;
    padding: 24px 32px;
}

.tab-view.active {
    display: block;
    animation: fadeSlideIn 0.25s cubic-bezier(0.25, 1, 0.5, 1) forwards; /* Native page slide */
}

/* Home Tab Styles */
.welcome-banner {
    margin-bottom: 30px;
}

.welcome-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.8px;
    margin-bottom: 6px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: -0.3px;
}

.recently-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.music-card {
    background-color: #161616;
    border-radius: 6px;
    padding: 16px;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.music-card:active {
    transform: scale(0.96); /* Native card press */
    opacity: 0.8;
}

.music-card:hover {
    background-color: #222;
}

.card-img-wrapper {
    position: relative;
    aspect-ratio: 1;
    margin-bottom: 14px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
}

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

.card-play-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 48px;
    height: 48px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(8px);
    transition: var(--transition-fast);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    border: none;
    cursor: pointer;
}

.card-play-btn i {
    color: #000;
    font-size: 22px;
}

.music-card:hover .card-play-btn {
    opacity: 1;
    transform: translateY(0);
}

.music-card:hover .card-play-btn:hover {
    transform: scale(1.06);
    background-color: var(--primary-hover);
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-artist {
    font-size: 12px;
    color: var(--text-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Table Style Lists for Playlists & Search Results */
.song-list-container {
    width: 100%;
}

.song-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.song-table th {
    text-align: left;
    color: var(--text-gray);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
}

.song-table td {
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-gray);
    vertical-align: middle;
}

.song-row {
    border-radius: 4px;
    transition: var(--transition-fast);
    cursor: pointer;
}

.song-row:active {
    transform: scale(0.98); /* Native row press */
}

.song-row:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.song-row:hover td {
    color: var(--text-white);
}

.song-row.playing td {
    color: var(--primary);
}

.song-number {
    font-size: 15px;
    width: 45px;
}

.song-title-col {
    display: flex;
    align-items: center;
    gap: 16px;
}

.song-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.song-details-meta {
    display: flex;
    flex-direction: column;
}

.song-title-text {
    font-weight: 600;
    color: var(--text-white);
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist-text {
    font-size: 12px;
    color: var(--text-gray);
    margin-top: 2px;
}

.song-album-text {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-actions-col {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition-fast);
    padding: 6px;
}

.btn-icon:hover {
    color: var(--text-white);
    transform: scale(1.1);
}

.btn-icon:active {
    transform: scale(0.9);
}

.btn-icon.play-row-btn {
    font-size: 18px;
}

.btn-icon.play-row-btn:hover {
    color: var(--primary);
}

/* Playlist Header Detail banner */
.playlist-banner {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 30px;
}

.playlist-cover-container {
    position: relative;
    width: 192px;
    height: 192px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.5);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(135deg, #2e2e2e 0%, #1c1c1c 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 70px;
    color: var(--text-gray);
}

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

.playlist-cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    transition: var(--transition-fast);
}

.playlist-cover-container:hover .playlist-cover-overlay {
    opacity: 1;
}

.playlist-banner-info {
    flex: 1;
}

.playlist-banner-type {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.playlist-banner-title {
    font-size: 64px;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
    margin: 8px 0;
}

/* Import Page forms */
.import-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.import-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
}

.import-header-icon {
    font-size: 40px;
    margin-bottom: 20px;
}

.import-header-icon.yt {
    color: #ff0000;
}

.import-header-icon.spot {
    color: var(--primary);
}

.import-card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.import-card-desc {
    color: var(--text-gray);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.import-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.spinner {
    display: none;
    border: 3px solid rgba(255,255,255,0.1);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border-left-color: var(--primary);
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ------------------------------------------ */
/* BOTTOM PLAYBACK DECK (Spotify Player Bar)  */
/* ------------------------------------------ */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 240px;
    right: 0;
    background-color: var(--player-bg);
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    align-items: center;
    padding: 0 24px;
    height: 90px;
    z-index: 100;
    cursor: pointer;
    transform: translateY(110%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.3);
}

.player-bar.active {
    transform: translateY(0);
}

/* Left - Current Song Details */
.player-left {
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: hidden;
}

.player-thumb {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    background-color: #282828;
}

.player-song-info {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.player-song-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-song-artist {
    font-size: 11px;
    color: var(--text-gray);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Center - Control Panel */
.player-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    justify-content: center;
    align-items: center;
}

.control-btn:hover {
    color: var(--text-white);
}

.control-btn:active {
    transform: scale(0.9);
}

.control-btn.active {
    color: var(--primary);
}

.control-btn.play-btn {
    width: 32px;
    height: 32px;
    background-color: var(--text-white);
    color: #000;
    border-radius: 50%;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.control-btn.play-btn:hover {
    transform: scale(1.08);
}

.player-timeline {
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-gray);
}

.timeline-slider-container {
    flex: 1;
    position: relative;
    height: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.slider-rail {
    width: 100%;
    height: 4px;
    background-color: #4f4f4f;
    border-radius: 2px;
    position: relative;
}

.slider-progress {
    height: 100%;
    background-color: var(--text-white);
    border-radius: 2px;
    width: 0%;
    transition: width 0.05s linear;
}

.timeline-slider-container:hover .slider-progress {
    background-color: var(--primary);
}

.slider-handle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--text-white);
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 0%;
    display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.timeline-slider-container:hover .slider-handle {
    display: block;
}

/* Right - Utilities */
.player-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 120px;
}

.volume-slider-wrapper {
    flex: 1;
    position: relative;
    height: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.volume-progress {
    height: 100%;
    background-color: var(--text-white);
    border-radius: 2px;
    width: 70%;
}

.volume-slider-wrapper:hover .volume-progress {
    background-color: var(--primary);
}

.volume-handle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--text-white);
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 70%;
    display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.volume-slider-wrapper:hover .volume-handle {
    display: block;
}

/* Modals & Popups (Playlist Adder) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-card {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    background-color: rgba(255,255,255,0.03);
    transition: var(--transition-fast);
}

.modal-item:active {
    transform: scale(0.96);
}

.modal-item:hover {
    background-color: rgba(255,255,255,0.1);
}

.modal-item-name {
    font-size: 14px;
    font-weight: 600;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-gray);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--text-muted);
}

/* ------------------------------------------ */
/* FULL SCREEN PLAYER MODAL OVERLAY          */
/* ------------------------------------------ */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000; /* Solid dark backdrop */
    z-index: 999;
    display: none;
    flex-direction: column;
    padding: 40px 60px;
    overflow: hidden;
    
    /* Smooth Transition */
    opacity: 0;
    transform: translateY(100vh);
    transition: opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1), transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.fullscreen-overlay.active {
    opacity: 1;
    transform: translateY(0);
}

/* Sync Beat Toggler Button Styling */
.sync-beat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.sync-beat-btn.circular {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
}

.sync-beat-btn i {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s ease;
}

.sync-beat-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.sync-beat-btn.active {
    background: rgba(29, 185, 84, 0.25);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 15px rgba(29, 185, 84, 0.4);
}

.sync-beat-btn.active i {
    color: var(--primary);
    animation: beat-icon-pulse 0.8s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes beat-icon-pulse {
    0% { transform: scale(0.9); }
    100% { transform: scale(1.3); }
}

/* Sync Beat Intensity Slider Styles */
.sync-beat-intensity-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 500px;
    gap: 8px;
    animation: slider-fade-in 0.3s ease forwards;
}

@keyframes slider-fade-in {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

#sync-beat-intensity-slider {
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    transition: background 0.3s;
}

#sync-beat-intensity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 5px var(--primary);
    transition: transform 0.1s ease;
}

#sync-beat-intensity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

@media (max-width: 768px) {
    .sync-beat-btn,
    .sync-beat-intensity-container {
        display: none !important;
    }
}

.fullscreen-bg-blur {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    filter: blur(80px);
    transform: scale(1.4);
    opacity: 0.35; /* Soft glowing ambient cover art aura */
    z-index: 1;
    pointer-events: none;
    transition: background-image 1.2s ease-in-out;
}

.fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
    position: relative;
    z-index: 2;
}

.fullscreen-header-logo {
    height: 56px;
    object-fit: contain;
}

.fullscreen-body {
    flex: 1;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    align-items: center;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.fullscreen-left-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    text-align: center;
    height: 100%;
}

@keyframes albumRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fullscreen-album-art {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
    object-fit: cover;
    background-color: #222;
    border: 8px solid rgba(255,255,255,0.06);
    transition: transform 0.5s ease;
}

.fullscreen-album-art.playing {
    animation: albumRotate 25s linear infinite;
}

.fullscreen-song-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.fullscreen-song-title {
    font-size: 28px;
    font-weight: 800;
    color: white;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.fullscreen-song-artist {
    font-size: 18px;
    color: rgba(255,255,255,0.75);
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.visualizer-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2; /* Sits above the blurred background but below text/controls */
    pointer-events: none;
    background-color: transparent !important;
    border: none !important;
    max-width: none !important;
    opacity: 0.35;
}

.fullscreen-right-panel {
    display: flex;
    flex-direction: column;
    height: 90%;
    background-color: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 24px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* Neon Outline Glow Style */
.neon-border {
    border-color: rgba(var(--dominant-cover-rgb), var(--neon-opacity)) !important;
    box-shadow: 0 0 var(--neon-glow) rgba(var(--dominant-cover-rgb), var(--neon-shadow-opacity)) !important;
    transition: border-color 0.1s ease, box-shadow 0.1s ease;
}

.comments-header {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.comments-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    padding-right: 8px;
}

.comment-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 13px;
    background-color: rgba(255,255,255,0.03);
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #333;
}

.comment-content {
    flex: 1;
    overflow: hidden;
}

.comment-author {
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comment-text-body {
    color: rgba(255,255,255,0.85);
    line-height: 1.4;
    word-break: break-word;
}

.comment-date {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    margin-top: 4px;
}

.comment-input-form {
    display: flex;
    gap: 10px;
}

.comment-input-form input {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 10px 18px;
    color: white;
    outline: none;
    font-size: 13px;
}

.comment-input-form input:focus {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: var(--primary);
}

.comment-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--primary);
    color: black;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.comment-send-btn:hover {
    transform: scale(1.05);
    background-color: var(--primary-hover);
}

.fullscreen-footer-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
}

.comment-action-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.comment-action-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.85);
}

.comment-delete-btn:hover {
    background: rgba(235, 87, 87, 0.15);
    color: #eb5757;
}

.comment-timestamp-btn {
    background: rgba(29, 185, 84, 0.12);
    border: 1px solid rgba(29, 185, 84, 0.25);
    border-radius: 20px;
    color: var(--primary);
    font-size: 11px;
    padding: 2px 8px;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
    letter-spacing: 0.2px;
}

.comment-timestamp-btn:hover {
    background: rgba(29, 185, 84, 0.25);
    transform: scale(1.04);
}

.comment-reply-ref {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    padding: 4px 8px;
    margin-bottom: 5px;
    font-style: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.comment-reply-ref em {
    font-style: italic;
    color: rgba(255, 255, 255, 0.3);
}

/* ============================================ */
/* PROFILE SETTINGS MODAL                        */
/* ============================================ */

.profile-settings-card {
    width: 100%;
    max-width: 380px;
    padding: 28px 24px 20px;
    border-radius: 20px;
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 16px 0 24px;
    text-align: center;
}

.avatar-camera-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #fff;
    font-size: 18px;
}

.user-avatar-container:hover .avatar-camera-overlay {
    opacity: 1;
}

.profile-setting-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
}

.profile-setting-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

.btn-save-username {
    background: var(--primary);
    border: none;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.btn-save-username:hover {
    transform: scale(1.07);
    background: #1ed760;
}

.btn-save-username:disabled {
    opacity: 0.6;
    transform: none;
}

.profile-actions-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.profile-action-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text-white);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    text-align: left;
}

.profile-action-btn:hover {
    background: var(--bg-card-hover);
}

.profile-action-btn i:first-child {
    font-size: 16px;
    width: 20px;
    color: var(--text-gray);
}

.profile-action-danger {
    color: #eb5757 !important;
    background: rgba(235, 87, 87, 0.08) !important;
    border-color: rgba(235, 87, 87, 0.2) !important;
}

.profile-action-danger i:first-child {
    color: #eb5757 !important;
}

.profile-action-danger:hover {
    background: rgba(235, 87, 87, 0.15) !important;
}

/* ============================================ */
/* CUSTOM DIALOG (Confirm / Prompt)             */
/* ============================================ */

.custom-dialog-card {
    max-width: 340px;
    width: calc(100% - 48px);
    padding: 28px 24px 24px;
    border-radius: 20px;
    transform: scale(0.85);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border-color);
}

#custom-dialog-overlay {
    display: none;
    z-index: 9998;
}

#custom-dialog-overlay[style*="flex"] .custom-dialog-card {
    transform: scale(1);
}

/* Light Theme Color Polish */

body.light-theme {
    color: var(--text-white);
}

body.light-theme .song-table th {
    color: var(--text-gray);
    border-bottom: 1px solid var(--border-color);
}

body.light-theme .song-table td {
    color: var(--text-white);
}

body.light-theme .song-row {
    border-bottom: 1px solid var(--border-color);
}

body.light-theme .welcome-banner {
    background: linear-gradient(135deg, #cbd5e1 0%, #f1f5f9 100%);
    border: 1px solid var(--border-color);
}

body.light-theme .playlist-banner {
    background: linear-gradient(180deg, #cbd5e1 0%, var(--bg-dark) 100%);
}

body.light-theme .modal-card {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

body.light-theme .modal-title {
    color: var(--text-white);
}

body.light-theme .modal-item {
    border-bottom: 1px solid var(--border-color);
}

body.light-theme .modal-item:hover {
    background-color: var(--bg-card-hover);
}

body.light-theme .modal-item-name {
    color: var(--text-white);
}

body.light-theme .import-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

body.light-theme .import-card-title {
    color: var(--text-white);
}

body.light-theme .form-label {
    color: var(--text-gray);
}

body.light-theme .form-control {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-white);
}

body.light-theme .form-control:focus {
    background-color: var(--bg-dark);
}

/* Light Theme Button Override (High Contrast) */
body.light-theme .control-btn.play-btn {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}

body.light-theme .control-btn {
    color: #4b5563;
}

body.light-theme .control-btn:hover {
    color: #0f172a;
}

/* Full-screen Player Text Override (Always light/high contrast on dark radial gradient) */
.fullscreen-overlay .fullscreen-song-title {
    color: #ffffff !important;
}

.fullscreen-overlay .fullscreen-song-artist {
    color: rgba(255, 255, 255, 0.75) !important;
}

.fullscreen-overlay .comments-header {
    color: #ffffff !important;
}

.fullscreen-overlay .comments-header span {
    color: #ffffff !important;
}

.fullscreen-overlay #comments-count {
    color: rgba(255, 255, 255, 0.5) !important;
}

.fullscreen-overlay .comment-author {
    color: #ffffff !important;
}

.fullscreen-overlay .comment-text-body {
    color: rgba(255, 255, 255, 0.85) !important;
}

.fullscreen-overlay .comment-date {
    color: rgba(255, 255, 255, 0.45) !important;
}

.fullscreen-overlay .control-btn {
    color: rgba(255, 255, 255, 0.6) !important;
}

.fullscreen-overlay .control-btn:hover {
    color: #ffffff !important;
}

.fullscreen-overlay .control-btn.active {
    color: var(--primary) !important;
}

.fullscreen-overlay .control-btn.play-btn {
    background-color: #ffffff !important;
    color: #000000 !important;
}

.fullscreen-overlay #fs-time-elapsed,
.fullscreen-overlay #fs-time-total {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Mobile Bottom Navigation Bar Styles */
.mobile-nav-bar {
    display: none; /* Desktop hidden */
}

/* ============================================ */
/* MOBILE RESPONSIVE LAYOUT (≤768px)            */
/* Premium App-style layout overhaul            */
/* ============================================ */
@media (max-width: 768px) {

    /* ---- Core Structure ---- */
    .app-container {
        display: flex;
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
        background-color: var(--bg-dark);
    }

    .app-container::-webkit-scrollbar, 
    .main-content::-webkit-scrollbar,
    .content-panel::-webkit-scrollbar,
    .sidebar::-webkit-scrollbar {
        display: none; /* Hide scrollbar Webkit */
    }

    .main-content {
        padding: 0;
        height: 100%;
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background-color: transparent;
        scrollbar-width: none;
    }

    .content-panel {
        border-radius: 0;
        background: transparent;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 100px; /* Clear bottom nav */
    }

    /* Adjust padding when player is active */
    body.player-active .content-panel,
    body.player-active .sidebar {
        padding-bottom: 180px !important;
    }

    /* Show sidebar ONLY on Home tab (if supported), else show everywhere at bottom */
    .sidebar {
        display: none !important;
    }
    
    /* Saat tab Playlist di bottom nav aktif */
    body.mobile-playlist-active .sidebar {
        display: flex !important;
        flex: 1; /* Mengisi sisa layar penuh */
        flex-direction: column;
        padding-top: 24px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 100px;
    }
    
    body.mobile-playlist-active .main-content {
        display: none !important; /* Sembunyikan konten lain saat buka playlist */
    }

    .sidebar .logo-container,
    .sidebar .nav-group,
    .sidebar .user-widget {
        display: none !important;
    }

    .library-section {
        padding: 0;
        background-color: transparent;
        overflow: visible;
    }

    /* Native-looking header for the mobile playlist section */
    .library-header {
        font-size: 17px;
        font-weight: 800;
        color: var(--text-white);
        margin-bottom: 12px;
        letter-spacing: -0.3px;
        padding: 0 16px;
    }

    body.light-theme .library-header {
        color: #0f172a;
    }

    .library-list {
        overflow: visible;
        padding: 0 16px;
    }

    /* ---- Mobile Top Header ---- */
    .main-header {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0 16px;
        height: 60px;
        background-color: var(--bg-dark);
        border-bottom: 1px solid var(--border-color);
        position: sticky;
        top: 0;
        z-index: 50;
        backdrop-filter: blur(12px);
    }

    /* When search is active, override to left-align */
    body.search-active .main-header {
        justify-content: flex-start;
    }

    .mobile-logo-header {
        display: flex !important;
        align-items: center;
        justify-content: center;
        flex: 1;
    }

    #app-mobile-header-logo {
        height: 46px !important;
        object-fit: contain;
    }

    .search-bar-container {
        flex: 1;
        max-width: 100%;
        width: 100%;
    }

    .search-input {
        font-size: 14px;
        padding: 10px 14px 10px 40px;
        width: 100%;
        border-radius: 12px;
        background-color: var(--bg-input);
    }

    .search-icon {
        left: 13px;
        font-size: 14px;
    }

    /* Search tab - full width search bar layout */
    #tab-search {
        padding: 12px 16px;
    }

    body.light-theme .main-header {
        background-color: rgba(255,255,255,0.9);
        border-bottom-color: var(--border-color);
    }

    body.light-theme .search-input {
        background-color: var(--bg-input);
        color: var(--text-white);
    }

    /* ---- Android-Style Bottom Nav Bar ---- */
    .mobile-nav-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(64px + env(safe-area-inset-bottom, 0px));
        background: rgba(18, 18, 18, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        justify-content: space-around;
        align-items: center;
        z-index: 200;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    body.light-theme .mobile-nav-bar {
        background: rgba(255, 255, 255, 0.96);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        font-size: 10px;
        font-weight: 600;
        cursor: pointer;
        flex: 1;
        height: 100%;
        gap: 4px;
        transition: color 0.2s ease;
        letter-spacing: 0.2px;
    }

    .mobile-nav-item i {
        font-size: 20px;
        transition: transform 0.2s ease;
    }

    .mobile-nav-item.active {
        color: var(--primary);
    }

    .mobile-nav-item.active i {
        transform: scale(1.1);
    }

    /* ---- Glassmorphic Mini Player Deck ---- */
    .player-bar {
        position: fixed;
        bottom: calc(72px + env(safe-area-inset-bottom, 0px)); /* Safe area adjusted */
        left: 10px;
        right: 10px;
        height: 68px;
        background: rgba(30, 30, 30, 0.95) !important;
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 12px; /* Native rounding */
        z-index: 150;
        padding: 0 14px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
        width: calc(100% - 20px) !important;
        transform: translateY(240%);
        transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    }

    body.light-theme .player-bar {
        background: rgba(255, 255, 255, 0.95) !important;
        border: 1px solid rgba(0, 0, 0, 0.07);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    }

    .player-bar.active {
        transform: translateY(0) !important;
    }

    .player-left {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .player-thumb {
        width: 46px;
        height: 46px;
        border-radius: 8px;
        flex-shrink: 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    }

    .player-song-title {
        font-size: 13px;
        font-weight: 700;
    }

    .player-song-artist {
        font-size: 11px;
        margin-top: 2px;
    }

    .player-center {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
    }

    .player-timeline,
    #ctrl-shuffle,
    #ctrl-repeat,
    #ctrl-prev {
        display: none !important;
    }

    .player-controls {
        margin-bottom: 0;
        gap: 4px;
    }

    #ctrl-next {
        font-size: 18px !important;
        color: var(--text-gray);
    }

    .player-controls .control-btn.play-btn,
    .control-btn.play-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 17px !important;
        background-color: var(--text-white) !important;
        color: #000 !important;
        border-radius: 50%;
    }

    body.light-theme .player-controls .control-btn.play-btn {
        background-color: var(--bg-black) !important;
        color: #fff !important;
    }

    .player-right {
        display: none !important;
    }

    /* ---- Home Tab ---- */
    .tab-view {
        padding: 16px;
    }

    .welcome-banner {
        background: linear-gradient(135deg, rgba(29, 185, 84, 0.12) 0%, rgba(29, 185, 84, 0.03) 100%);
        border: 1px solid rgba(29, 185, 84, 0.15);
        padding: 20px 16px;
        margin: 0 0 20px 0;
        border-radius: 16px;
        text-align: left;
    }

    .welcome-title {
        font-size: 22px;
        letter-spacing: -0.5px;
    }

    .welcome-banner p {
        font-size: 13px;
        margin-top: 4px;
    }

    .section-title {
        font-size: 17px;
        font-weight: 800;
        margin: 0 0 12px 0;
        letter-spacing: -0.3px;
    }

    /* ---- Music Cards Grid ---- */
    .recently-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 0;
        margin-bottom: 24px;
    }

    .music-card {
        padding: 10px;
        border-radius: 12px;
        background-color: var(--bg-card);
    }

    .card-img-wrapper {
        border-radius: 8px;
        margin-bottom: 10px;
    }

    .card-title {
        font-size: 12px;
        font-weight: 700;
        margin-top: 2px;
    }

    .card-artist {
        font-size: 11px;
    }

    .card-play-btn {
        width: 38px;
        height: 38px;
        right: 6px;
        bottom: 6px;
    }

    .card-play-btn i {
        font-size: 16px;
    }

    /* ---- Song Table (Search & Playlist) ---- */
    .song-list-container {
        border-radius: 12px;
        overflow: hidden;
    }

    .song-table th:nth-child(1),
    .song-table td:nth-child(1),
    .song-table th:nth-child(3),
    .song-table td:nth-child(3),
    .song-table th:nth-child(4),
    .song-table td:nth-child(4) {
        display: none;
    }

    .song-table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .song-table th {
        font-size: 11px;
        padding: 10px 12px !important;
        background-color: var(--bg-card);
    }

    .song-table td {
        padding: 10px 12px !important;
        vertical-align: middle;
    }

    .song-row {
        transition: background-color 0.15s;
    }

    .song-thumb {
        width: 44px;
        height: 44px;
        border-radius: 8px;
    }

    .song-title-col {
        gap: 12px;
    }

    .song-title-text {
        font-size: 13px;
        font-weight: 700;
        max-width: 200px;
    }

    /* ---- Playlist Detail Banner ---- */
    .playlist-banner {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 24px 16px 16px !important;
        gap: 14px !important;
        background: linear-gradient(180deg, rgba(29,185,84,0.08) 0%, transparent 100%);
        border-radius: 12px;
        margin-bottom: 16px;
    }

    .playlist-cover-container {
        width: 140px;
        height: 140px;
        border-radius: 12px;
        box-shadow: 0 12px 30px rgba(0,0,0,0.4);
    }

    .playlist-banner-title {
        font-size: 22px;
        font-weight: 800;
        letter-spacing: -0.5px;
        line-height: 1.2;
    }

    .playlist-banner-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    /* Playlist action buttons row */
    .playlist-banner ~ div {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
        padding: 0 0 16px 0;
        margin-bottom: 4px;
    }

    /* ---- Import Page ---- */
    .import-cards {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        padding: 0;
    }

    .import-card {
        padding: 22px 18px;
        border-radius: 16px;
    }

    .import-header-icon {
        font-size: 32px;
        margin-bottom: 14px;
    }

    .import-card-title {
        font-size: 18px;
    }

    .import-card-desc {
        font-size: 13px;
        margin-bottom: 18px;
    }

    /* ---- Full Screen Player (Mobile) ---- */
    .fullscreen-overlay {
        padding: 16px 16px 24px;
        flex-direction: column;
    }

    .fullscreen-header {
        height: 50px;
        margin-bottom: 12px;
    }

    .fullscreen-header-logo {
        height: 38px;
    }

    .fullscreen-body {
        display: flex;
        flex-direction: column;
        align-items: center;
        overflow-y: auto;
        overflow-x: hidden;
        gap: 0;
        padding: 0;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }

    .fullscreen-left-panel {
        width: 100%;
        max-width: 100%;
        margin: 0;
        gap: 20px;
        padding: 12px 0 0;
        align-items: center;
    }

    .fullscreen-album-art {
        width: 220px;
        height: 220px;
        border-radius: 50%;
        box-shadow: 0 20px 50px rgba(0,0,0,0.7);
    }

    .fullscreen-song-details {
        align-items: center;
        text-align: center;
        gap: 6px;
        width: 100%;
        padding: 0 8px;
    }

    .fullscreen-song-title {
        font-size: 20px;
        font-weight: 800;
    }

    .fullscreen-song-artist {
        font-size: 14px;
    }

    .fullscreen-footer-controls {
        width: 100%;
        padding: 0 8px;
        margin-top: 0;
        gap: 14px;
    }

    .fullscreen-footer-controls .player-controls {
        gap: 20px;
    }

    .fullscreen-footer-controls .player-timeline {
        display: flex !important;
        max-width: 100%;
    }

    .fullscreen-right-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.06);
        padding: 16px 4px 0;
        margin-top: 20px;
        height: 260px;
        background-color: rgba(0, 0, 0, 0.25);
        backdrop-filter: blur(6px);
        border-radius: 12px;
        flex-shrink: 0;
    }

    /* Smooth active tab indicator */
    .mobile-nav-item.active::after {
        content: '';
        display: block;
        width: 4px;
        height: 4px;
        background-color: var(--primary);
        border-radius: 50%;
        position: absolute;
        bottom: 8px;
    }

    .mobile-nav-item {
        position: relative;
    }
}