/* Nya Music Modern Monochrome Glassmorphism Styling */
:root {
    --bg-main: #000000;
    --bg-sidebar: rgba(14, 14, 14, 0.85);
    --bg-card: rgba(22, 22, 22, 0.7);
    --bg-card-hover: rgba(36, 36, 36, 0.9);
    --accent: #ffffff; /* Monochrome White */
    --accent-hover: #e0e0e0;
    --accent-secondary: #2c2c2e;
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --text-muted: #636366;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-color-hover: rgba(255, 255, 255, 0.2);
    --player-bg: rgba(16, 16, 16, 0.9);
    --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", -system-ui, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    display: flex;
    user-select: none;
}

/* Glass background overlay */
.bg-ambient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.05), transparent 45%),
                radial-gradient(circle at 85% 85%, rgba(255, 255, 255, 0.03), transparent 45%);
    pointer-events: none;
    z-index: 0;
}

/* Layout */
.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    height: calc(100vh - 80px);
    background: var(--bg-sidebar);
    backdrop-filter: blur(30px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 28px;
    padding-left: 8px;
    color: var(--text-primary);
}

.brand i {
    color: var(--text-primary);
    font-size: 24px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.8px;
    padding: 0 10px 8px 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: #d1d1d6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-weight: 600;
}

.nav-item.active i {
    color: #ffffff;
}

.user-profile-badge {
    margin-top: auto;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.user-avatar-mini {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background: #333;
}

.user-meta {
    overflow: hidden;
    flex-grow: 1;
}

.user-name-label {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-label {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Main Content Area */
.main-view {
    flex-grow: 1;
    height: calc(100vh - 80px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: 60px;
    padding: 0 32px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(25px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.search-box {
    position: relative;
    width: 320px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
}

.search-box input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid transparent;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.search-box input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.content-pane {
    padding: 28px 36px;
    max-width: 1400px;
    width: 100%;
    box-sizing: border-box;
}

/* Grid & Cards */
.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.media-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.media-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.card-art-wrap {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    background: #1c1c1e;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.card-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-play-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.25s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

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

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

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

/* Track list */
.track-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.track-table th {
    text-align: left;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
}

.track-table td {
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.track-row {
    transition: background 0.15s;
    cursor: pointer;
}

.track-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.track-cell-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.track-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: #222;
}

.track-info {
    overflow: hidden;
}

.track-name {
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 6px;
    transition: color 0.15s;
}

.btn-icon:hover {
    color: #fff;
}

.btn-icon.active-heart {
    color: #ffffff;
}

/* Nya Music Bottom Player */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 80px;
    background: var(--player-bg);
    backdrop-filter: blur(35px);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.player-left {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 25%;
    min-width: 200px;
}

.player-cover {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    background: #1c1c1e;
}

.player-track-info {
    overflow: hidden;
}

.player-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.player-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 50%;
    max-width: 600px;
}

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

.ctrl-btn {
    background: none;
    border: none;
    color: #ccc;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.15s;
}

.ctrl-btn:hover {
    color: #fff;
}

.ctrl-play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.ctrl-play:hover {
    transform: scale(1.06);
    color: #000;
    background: #fff;
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-label {
    font-size: 11px;
    color: var(--text-secondary);
    width: 35px;
    font-variant-numeric: tabular-nums;
}

.progress-bar-wrap {
    flex-grow: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: #fff;
    border-radius: 2px;
    width: 0%;
    position: relative;
}

.progress-bar-wrap:hover .progress-fill {
    background: #ffffff;
}

.player-right {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 25%;
    justify-content: flex-end;
}

.volume-slider {
    width: 100px;
    accent-color: #ffffff;
    cursor: pointer;
}

/* Modals & Buttons */
.btn-apple-primary {
    background: #ffffff;
    color: #000000;
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-apple-primary:hover {
    background: #e5e5e5;
    color: #000000;
}

.btn-apple-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-apple-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-content {
    background: rgba(30, 30, 32, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 440px;
    max-width: 90vw;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

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

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

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: #fff;
    font-size: 14px;
    outline: none;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: #ffffff;
}

/* Admin panels & tables */
.admin-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: rgba(255, 255, 255, 0.15); color: #ffffff; border: 1px solid rgba(255, 255, 255, 0.2); }
.badge-danger { background: rgba(255, 255, 255, 0.08); color: #8e8e93; border: 1px solid rgba(255, 255, 255, 0.1); }
.badge-warning { background: rgba(255, 255, 255, 0.1); color: #d1d1d6; border: 1px solid rgba(255, 255, 255, 0.15); }

/* Shared Page */
.shared-page-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 100vh;
}

.shared-container {
    width: 100%;
    max-width: 580px;
    padding: 20px;
}

.shared-card {
    background: rgba(28, 28, 30, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    backdrop-filter: blur(30px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    text-align: center;
}

.shared-cover-wrap {
    width: 220px;
    height: 220px;
    margin: 0 auto 20px auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}

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

.shared-badge {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.shared-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.shared-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.shared-album-tracks {
    text-align: left;
    margin-bottom: 24px;
    max-height: 200px;
    overflow-y: auto;
}

.track-list-mini {
    list-style: none;
    margin-top: 10px;
}

/* Mobile Menu & Drawer Controls */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    padding: 8px;
    cursor: pointer;
    margin-right: 12px;
}

.mobile-close-sidebar {
    display: none;
    margin-left: auto;
    font-size: 18px;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 140;
}

.mobile-tab-bar {
    display: none;
}

/* ==================== MOBILE RESPONSIVE STYLES ==================== */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
    }

    .app-container {
        height: auto;
        min-height: 100vh;
    }

    /* Sidebar drawer on mobile */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-close-sidebar {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 270px;
        height: 100vh;
        z-index: 150;
        background: rgba(14, 14, 14, 0.96);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .sidebar.open {
        transform: translateX(280px);
    }

    .sidebar-backdrop.active {
        display: block;
    }

    .main-view {
        width: 100vw;
        height: auto;
        min-height: 100vh;
        padding-bottom: 140px; /* Room for player bar + mobile tab bar */
    }

    .top-bar {
        padding: 0 16px;
        height: 56px;
    }

    .search-box {
        width: 100%;
        max-width: none;
    }

    .content-pane {
        padding: 16px;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 14px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .media-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 24px;
    }

    .media-card {
        padding: 8px;
    }

    .card-title {
        font-size: 13px;
    }

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

    .card-play-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
        opacity: 0.9;
        transform: none;
    }

    /* Detail view header */
    .detail-header-wrap {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
        gap: 16px !important;
        margin-bottom: 24px !important;
    }

    .detail-cover-box {
        width: 160px !important;
        height: 160px !important;
        margin: 0 auto;
    }

    .detail-title {
        font-size: 22px !important;
    }

    /* Track Table on mobile */
    .track-table th:nth-child(3),
    .track-table td:nth-child(3),
    .track-table th:nth-child(4),
    .track-table td:nth-child(4) {
        display: none; /* Hide album and duration columns on small screens */
    }

    .track-table th, .track-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .track-thumb {
        width: 36px;
        height: 36px;
    }

    .track-name {
        max-width: 140px;
        font-size: 13px;
    }

    .track-artist {
        max-width: 140px;
    }

    /* Player Bar mobile */
    .player-bar {
        height: 64px;
        bottom: 56px; /* Sits right above bottom tab bar */
        padding: 0 12px;
        background: rgba(14, 14, 14, 0.96);
    }

    .player-left {
        width: 65%;
        min-width: 0;
        gap: 10px;
    }

    .player-cover {
        width: 42px;
        height: 42px;
    }

    .player-title {
        font-size: 13px;
        max-width: 120px;
    }

    .player-artist {
        font-size: 11px;
        max-width: 120px;
    }

    #player-fav-btn, #player-share-btn {
        display: none;
    }

    .player-center {
        width: auto;
        flex-direction: row;
        justify-content: flex-end;
    }

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

    #ctrl-prev, #ctrl-next {
        font-size: 14px;
    }

    .ctrl-play {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .progress-container {
        display: none; /* Progress hidden or compact on tiny mobile */
    }

    .player-right {
        display: none; /* Volume slider hidden on mobile, hardware buttons used */
    }

    /* Mobile Bottom Tab Bar */
    .mobile-tab-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100vw;
        height: 56px;
        background: rgba(10, 10, 10, 0.97);
        backdrop-filter: blur(25px);
        border-top: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        justify-content: space-around;
        z-index: 110;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .mobile-tab-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--text-secondary);
        font-size: 10px;
        font-weight: 500;
        flex: 1;
        height: 100%;
        cursor: pointer;
        transition: color 0.15s ease;
    }

    .mobile-tab-item i {
        font-size: 16px;
    }

    .mobile-tab-item.active {
        color: #ffffff;
    }

    .mobile-tab-item.active i {
        color: #ffffff;
    }

    /* Modal adjustments */
    .modal-content {
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
}

