/**
 * Mobile Bottom Navigation Styles
 * Нижняя навигация для мобильных устройств (летающее меню)
 */

/* Мобильная навигация - летающий стиль */
.mobile-bottom-nav {
    position: fixed;
    bottom: 16px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: var(--glass-border);
    padding: 12px 16px;
    z-index: var(--z-sticky);
    box-shadow: var(--glass-shadow);

    /* Полностью скругленное летающее меню */
    border-radius: var(--glass-radius);
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 14px;
    min-width: 70px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    border-radius: var(--radius-lg);
    position: relative;
    background: transparent;
    border: none;
    font-family: inherit;
    cursor: pointer;
}

.mobile-bottom-nav .nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    transition: all var(--transition-fast);
}

.mobile-bottom-nav .nav-item span {
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1;
}

/* Активное состояние */
.mobile-bottom-nav .nav-item.active {
    color: var(--accent-tertiary);
    background: rgba(14, 165, 233, 0.12);
}

.mobile-bottom-nav .nav-item.active svg {
    stroke: var(--accent-tertiary);
    transform: translateY(-2px);
}

/* Hover эффект для устройств с мышью */
@media (hover: hover) {
    .mobile-bottom-nav .nav-item:hover {
        color: var(--text-primary);
        background: var(--bg-hover);
    }
}

/* Скрыть на десктопе */
@media (min-width: 1100px) {
    .mobile-bottom-nav {
        display: none;
    }

    .mobile-profile-popup {
        display: none !important;
    }
}

/* Добавить отступ снизу для контента на мобильных */
@media (max-width: 1099px) {

    .content-wrapper,
    .main-content,
    .profile-main,
    .schedule-page,
    .wallet-page {
        padding-bottom: calc(55px + env(safe-area-inset-bottom)) !important;
    }
}

/* ========================================
   Mobile Profile Popup
   ======================================== */

.mobile-profile-popup {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-modal) + 10);
    display: flex;
    align-items: flex-end;
    opacity: 1;
    visibility: visible;
    transition: all var(--transition-normal);
}

.mobile-profile-popup.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.profile-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.profile-popup-content {
    position: relative;
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px 20px 0 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.mobile-profile-popup.hidden .profile-popup-content {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(100%);
    }
}

.profile-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.profile-popup-header h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
}

.profile-popup-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.profile-popup-close:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.profile-popup-user {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.profile-popup-avatar {
    width: 56px;
    height: 56px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.profile-popup-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.profile-popup-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.profile-popup-role {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.profile-popup-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-popup-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    width: 100%;
}

.profile-popup-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.profile-popup-item:hover,
.profile-popup-item:active {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.profile-popup-item.logout {
    color: var(--color-danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.profile-popup-item.logout:hover,
.profile-popup-item.logout:active {
    background: var(--color-danger-light);
    border-color: var(--color-danger);
}

/* ========================================
   Mobile Wallet Section
   ========================================*/

.mobile-wallet-section {
    margin: 20px 0;
    padding: 16px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(99, 102, 241, 0.08));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.mobile-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-balance-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.mobile-balance-value {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-balance-value>span:first-child {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mobile History Button */
.mobile-history-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    margin-top: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.mobile-history-btn:hover,
.mobile-history-btn:active {
    border-color: var(--border-hover);
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.mobile-history-btn svg {
    flex-shrink: 0;
}