/* Фиксированная шапка и навигация для всех страниц механика */

/* ============================================
   ШАПКА (PAGE HEADER)
   ============================================ */

.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    /* Фиксированная позиция */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    /* Фиксированная высота для десктопа */
    height: 85px;
    display: flex;
    align-items: center;
}

.page-header-content {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.page-header h1 {
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* ============================================
   НАВИГАЦИЯ (прикреплена снизу шапки)
   ============================================ */

.nav-wrapper {
    /* Фиксированная позиция сразу под шапкой */
    position: fixed;
    top: 85px; /* Высота шапки */
    left: 0;
    right: 0;
    z-index: 999;
    background: #f5f7fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid #e5e7eb;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

.nav {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    margin: 0;
    flex-wrap: wrap;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.nav a {
    padding: 10px 20px;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
    border: 2px solid transparent;
    font-size: 14px;
}

.nav a:hover {
    background: #f0f4ff;
    border-color: #667eea;
    transform: translateY(-2px);
}

.nav a.active {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ============================================
   ОТСТУП ДЛЯ КОНТЕНТА
   ============================================ */

/* Добавляем отступ сверху для всего контента, чтобы он не перекрывался шапкой и меню */
body {
    padding-top: 170px; /* Высота шапки (85px) + навигация с отступами (~85px) */
}

.container {
    padding-top: 0;
    margin-top: 0;
}

.main-content {
    padding-top: 0;
    margin-top: 0;
}

/* ============================================
   АДАПТАЦИЯ ДЛЯ ПЛАНШЕТОВ
   ============================================ */

@media (max-width: 768px) {
    .page-header {
        height: 70px; /* Меньше высота на планшетах */
    }
    
    .page-header-content {
        padding: 0 20px;
    }
    
    .page-header h1 {
        font-size: 1.2em;
    }
    
    .header-actions {
        gap: 10px;
    }
    
    .nav-wrapper {
        top: 70px; /* Высота шапки на планшете */
    }
    
    .nav-container {
        padding: 0 20px;
    }
    
    .nav {
        gap: 8px;
        padding: 10px 0;
    }
    
    .nav a {
        padding: 8px 16px;
        font-size: 13px;
        flex: 1 1 auto;
        text-align: center;
        min-width: fit-content;
    }
    
    body {
        padding-top: 145px; /* Высота шапки (70px) + навигация с отступами (~75px) */
    }
    
    .container {
        padding-top: 0;
        margin-top: 0;
    }
    
    .main-content {
        padding-top: 0;
        margin-top: 0;
    }
}

/* ============================================
   АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ
   ============================================ */

@media (max-width: 480px) {
    .page-header {
        height: 60px;
    }
    
    .page-header-content {
        padding: 0 15px;
    }
    
    .page-header h1 {
        font-size: 1em;
    }
    
    .nav-wrapper {
        top: 60px;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .nav {
        gap: 6px;
        padding: 8px 0;
    }
    
    .nav a {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    body {
        padding-top: 125px; /* Высота шапки (60px) + навигация с отступами (~65px) */
    }
    
    .container {
        padding-top: 0;
        margin-top: 0;
    }
    
    .main-content {
        padding-top: 0;
        margin-top: 0;
    }
}

/* ============================================
   RTL ПОДДЕРЖКА (для иврита)
   ============================================ */

[dir="rtl"] .nav {
    direction: rtl;
}

[dir="rtl"] .page-header-content {
    direction: rtl;
}

/* ============================================
   КНОПКИ В ШАПКЕ
   ============================================ */

.btn-logout,
.btn-header {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    background: white;
    color: #667eea;
    font-size: 14px;
    border: 2px solid rgba(255,255,255,0.3);
}

.btn-logout:hover,
.btn-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,255,255,0.3);
}

@media (max-width: 768px) {
    .btn-logout,
    .btn-header {
        padding: 6px 12px;
        font-size: 12px;
    }
}
