/* ============================================================
 * nav.css 
 * - Sidebar sinistra (desktop) con logo, link, bottone "Componi"
 * - Sidebar destra (desktop): pannelli "trending", profilo
 * - Bottom-nav (mobile)
 *
 * @author Rigoni
 * ============================================================ */

/* ---------- Sidebar sinistra ---------- */
.nav-left {
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    gap: 4px;
    height: 100%;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    text-decoration: none;
}

.nav-brand__logo {
    width: 36px;
    height: 36px;
    color: var(--accent);
    flex-shrink: 0;
}

.nav-brand__name {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-strong);
    letter-spacing: -0.5px;
}
.nav-brand__name span { color: var(--accent); }

.nav-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: var(--r-pill);
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 500;
    transition: background var(--t-fast), color var(--t-fast);
    text-decoration: none;
}

.nav-link svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.nav-link:hover {
    background: var(--surface-2);
    color: var(--text-strong);
}

.nav-link.active {
    font-weight: 800;
    color: var(--text-strong);
}
.nav-link.active svg { color: var(--accent); }

.nav-cta {
    margin-top: 12px;
    background: var(--accent);
    color: #000;
    padding: 14px;
    border-radius: var(--r-pill);
    font-weight: 800;
    font-size: 1rem;
    text-align: center;
    cursor: pointer;
    transition: background var(--t-fast), box-shadow var(--t-fast);
    border: none;
}
.nav-cta:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-glow);
}

/* User card in fondo alla sidebar */
.nav-user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--r-pill);
    cursor: pointer;
    transition: background var(--t-fast);
    text-decoration: none;
    color: var(--text);
}
.nav-user:hover { background: var(--surface-2); }

.nav-user__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--accent);
    flex-shrink: 0;
    overflow: hidden;
}
.nav-user__avatar img {
    width: 100%; height: 100%; object-fit: cover;
}

.nav-user__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.nav-user__name {
    font-weight: 700;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-user__handle {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Tablet: sidebar collassata (solo icone) ---------- */
@media (max-width: 1100px) {
    .nav-brand__name,
    .nav-link span,
    .nav-cta__text,
    .nav-user__meta {
        display: none;
    }
    .nav-link { justify-content: center; padding: 12px; }
    .nav-cta {
        width: 50px; height: 50px;
        padding: 0;
        display: flex; align-items: center; justify-content: center;
        font-size: 1.5rem;
        margin: 12px auto 0;
    }
    .nav-user { justify-content: center; }
}

/* ---------- Sidebar destra ---------- */
.right-panel {
    background: var(--surface);
    border-radius: var(--r-lg);
    padding: 16px;
    margin-bottom: 16px;
}

.right-panel h3 {
    font-size: 1.25rem;
    margin: 0 0 12px 0;
    color: var(--text-strong);
}

.search-bar {
    position: sticky;
    top: 0;
    background: var(--bg);
    padding-bottom: 8px;
    margin-bottom: 8px;
    z-index: 5;
}
.search-bar input {
    width: 100%;
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    padding: 12px 18px 12px 44px;
    color: var(--text);
    transition: background var(--t-fast), border-color var(--t-fast);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371767b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
    background-size: 18px;
}
.search-bar input:focus {
    outline: none;
    background-color: var(--bg);
    border-color: var(--accent);
}

.trend-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--t-fast);
    border-radius: var(--r-sm);
    padding-left: 8px;
}
.trend-item:last-child { border-bottom: none; }
.trend-item:hover { background: var(--surface-2); }
.trend-item__title { font-weight: 700; color: var(--text-strong); }
.trend-item__meta  { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Bottom-nav (mobile) ---------- */
.nav-bottom {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}

.nav-bottom__inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.nav-bottom .nav-link {
    flex-direction: column;
    gap: 2px;
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: 600;
}
.nav-bottom .nav-link svg { width: 22px; height: 22px; }
.nav-bottom .nav-link:hover { background: transparent; }
.nav-bottom .nav-link.active svg { color: var(--accent); }
.nav-bottom .nav-link span { font-size: 0.7rem; }

@media (max-width: 720px) {
    .nav-bottom { display: block; }
}