/* ============================================================================
   BOTTOM TOOLBAR - Wikipedia Dark Mode Theme
   ============================================================================ */

.bottom-toolbar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    
    display: flex;
    align-items: flex-end;
    gap: 12px;
    
    background: rgba(39, 41, 42, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid #3a3b3c;
    border-radius: 4px;
    padding: 12px 20px;
    
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    
    z-index: 1000;
    
    transition: all 0.2s ease;
}

.bottom-toolbar:hover {
    background: rgba(42, 43, 44, 0.9);
    border-color: #4a4b4c;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Группа инструментов - горизонтальная: кнопки сверху, заголовок снизу */
.toolbar-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

/* Метка группы - заголовок снизу */
.toolbar-label {
    font-size: 0.7rem;
    color: #a2a9b1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    white-space: nowrap;
    text-align: center;
    width: 100%;
    order: 2;
}

/* Кнопки располагаются горизонтально сверху */
.toolbar-btn {
    order: 1;
}

/* Дополнительные стили кнопки панели - иконка сверху, подпись снизу */
.toolbar-btn {
    width: 56px;
    height: 56px;
    
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    
    background: #202122;
    border: 1px solid #3a3b3c;
    border-radius: 2px;
    
    cursor: pointer;
    transition: all 0.15s ease;
    
    position: relative;
    padding: 6px 4px;
    margin: 0 3px;
}

.toolbar-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: background 0.15s ease;
}

.toolbar-btn:hover {
    background: #2a2b2c;
    border-color: #4a4b4c;
}

.toolbar-btn:hover::before {
    background: #3366cc;
}

.toolbar-btn:active {
    transform: translateY(0);
    background: #323334;
}

/* Иконка кнопки */
.toolbar-icon {
    font-size: 1.4rem;
    position: relative;
    z-index: 1;
    user-select: none;
    color: #eaecf0;
}

/* Буквенные иконки */
.toolbar-icon-letter {
    color: #eaecf0;
    font-size: 1.4rem;
    line-height: 1;
}

/* Подпись кнопки снизу иконки */
.toolbar-btn-label {
    font-size: 0.6rem;
    color: #a2a9b1;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: relative;
    z-index: 1;
    user-select: none;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
}

/* Разделитель */
.toolbar-separator {
    width: 1px;
    height: 60px;
    background: #3a3b3c;
    margin: 0 8px;
    align-self: center;
}

/* Адаптивность */
@media (max-width: 768px) {
    .bottom-toolbar {
        bottom: 20px;
        padding: 10px 16px;
        gap: 8px;
        max-width: calc(100vw - 40px);
        overflow-x: auto;
    }
    
    .toolbar-btn {
        width: 50px;
        height: 50px;
        padding: 4px 2px;
    }
    
    .toolbar-icon {
        font-size: 1.2rem;
    }
    
    .toolbar-icon-letter {
        font-size: 1rem;
    }
    
    .toolbar-btn-label {
        font-size: 0.55rem;
    }
    
    .toolbar-label {
        font-size: 0.65rem;
    }
    
    .toolbar-group {
        gap: 4px;
    }
    
    .toolbar-separator {
        height: 50px;
    }
}

/* Анимация появления */
@keyframes toolbarSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.bottom-toolbar {
    animation: toolbarSlideUp 0.3s ease;
}