/*
Theme Name: PapayaBeat Theme
File: assets/css/nav.css
Description: Tyylit päänavigaatiolle (Sidebar & Bottom Tab Bar).
Version: 1.3
*/

/* --- 1. SIDEBAR (Desktop) --- */
.papaya-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background-color: #000;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 8000;
    border-right: 1px solid #1a1a1a;
    transition: transform 0.3s ease;
}

.papaya-sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-logo {
    margin-bottom: 30px;
    padding-left: 8px;
}
.sidebar-logo a {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-logo .dashicons {
    color: var(--papaya-orange);
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #b3b3b3;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    gap: 16px;
}

.nav-item:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: #fff;
    background-color: rgba(255, 140, 66, 0.1);
    border-left: 3px solid var(--papaya-orange);
}

.nav-item .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.library-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #1a1a1a;
}
.library-title {
    color: #888;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-left: 16px;
    margin-bottom: 16px;
}

/* --- 2. BOTTOM TAB BAR (Mobile) --- */
.papaya-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 8500;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #888;
    text-decoration: none;
    font-size: 0.7rem;
    gap: 4px;
    width: 100%;
    height: 100%;
}

.tab-item.active {
    color: #fff;
}
.tab-item.active .dashicons {
    color: var(--papaya-orange);
}

.tab-item .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

/* --- 3. RESPONSIVE LOGIC --- */

@media (max-width: 768px) {
    .papaya-sidebar { display: none; }
    .papaya-tab-bar { display: flex; }

    body.has-player .papaya-tab-bar {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }

    /* Mobiilissa ei marginaalia vasemmalla */
    #papaya-app-container,
    .papaya-page-container {
        margin-left: 0 !important;
        width: 100%;
        padding: 20px;
        padding-bottom: 140px;
    }
}

/* --- 4. LAYOUT FIX (CRITICAL) --- */
@media (min-width: 769px) {
    /* Tämä sääntö siirtää pääsisällön oikealle, jotta se ei jää sivupalkin alle.
       Käytetään !important varmistukseksi.
    */
    body.logged-in #papaya-app-container,
    body.logged-in .papaya-page-container {
        margin-left: 240px !important; /* Sivupalkin leveys */
        width: calc(100% - 240px) !important;
        padding: 40px;
        box-sizing: border-box;
    }

    #papaya-app-container,
    .papaya-page-container {
        padding-bottom: 120px; /* Tilaa soittimelle */
    }
}
