/* ============================================
   MOBILE CONTEXTUAL NAVIGATION
   VK-specific bottom navigation for mobile
   ============================================ */

/* Show only on mobile when inside Vidyākendra */
.vk-mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 999;
    box-shadow: 0 -4px 20px var(--shadow);
}

/* Only show on mobile devices */
@media (max-width: 768px) {
    .vk-mobile-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }
    
    /* Add padding to body when nav is present */
    body.vk-page {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
}

.vk-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    text-decoration: none;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.7rem;
    font-family: 'Crimson Text', 'Georgia', serif;
    border-radius: 8px;
    position: relative;
}

.vk-nav-item i {
    font-size: 1.4rem;
    margin-bottom: 4px;
    transition: transform 0.2s ease;
}

.vk-nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

.vk-nav-item:active {
    transform: scale(0.95);
    background: var(--bg-primary);
}

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

.vk-nav-item:hover i {
    transform: scale(1.1);
}

/* Active page indicator */
.vk-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 0 0 3px 3px;
}

/* Context Menu (slides up from nav item) */
.vk-context-menu {
    position: fixed;
    bottom: 70px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
    border-radius: 20px 20px 0 0;
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 998;
    box-shadow: 0 -10px 40px var(--shadow);
}

.vk-context-menu.active {
    transform: translateY(0);
}

.context-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.context-menu-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.close-context-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
}

.close-context-btn:hover {
    color: var(--accent-primary);
}

.context-menu-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.context-menu-item:active {
    transform: scale(0.98);
}

.context-menu-item i {
    font-size: 1.3rem;
    color: var(--accent-primary);
    width: 30px;
    text-align: center;
}

.context-item-content {
    flex: 1;
}

.context-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.context-item-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Overlay for context menu */
.vk-context-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 997;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vk-context-overlay.active {
    display: block;
    opacity: 1;
}

/* Connection count badge */
.connection-count {
    position: absolute;
    top: 4px;
    right: 8px;
    background: var(--accent-primary);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* Dark mode adjustments */
[data-theme="dark"] .vk-mobile-nav {
    background: rgba(26, 20, 16, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

[data-theme="dark"] .vk-context-menu {
    background: rgba(26, 20, 16, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

[data-theme="dark"] .vk-context-overlay {
    background: rgba(0, 0, 0, 0.5);
}

/* Animation for menu items */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vk-context-menu.active .context-menu-item {
    animation: slideInUp 0.3s ease forwards;
}

.vk-context-menu.active .context-menu-item:nth-child(1) { animation-delay: 0.05s; }
.vk-context-menu.active .context-menu-item:nth-child(2) { animation-delay: 0.1s; }
.vk-context-menu.active .context-menu-item:nth-child(3) { animation-delay: 0.15s; }
.vk-context-menu.active .context-menu-item:nth-child(4) { animation-delay: 0.2s; }
.vk-context-menu.active .context-menu-item:nth-child(5) { animation-delay: 0.25s; }