/* Переменные */
:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --white: #ffffff;
    --danger-color: #e74c3c;
    --light-bg: #f8f9fa;
    --text-color: #2c3e50;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
}

/* Импорт шрифтов */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

header {
    width: 100%;
    padding: 15px 0;
    background: var(--white);
    display: flex;
    justify-content: center;
    position: fixed;
    z-index: 1000;
    box-shadow: var(--box-shadow);
    border-bottom: 1px solid #e9ecef;
}

header p {
    margin: 16px;
    color: var(--primary-color);
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
}

#headerContent {
    width: 1170px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    gap: 20px;
}

/* Левая часть - логотипы */
#headerLeftPart {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.header-logo-name {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-decoration: none;
    transition: var(--transition);
}

.header-logo-name:hover {
    transform: translateY(-1px);
}

.header-logo-name>p {
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    margin: 0 0 0 12px;
    font-family: 'Roboto', sans-serif;
}

#uniIcon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    transition: var(--transition);
}

#saprIcon {
    width: 35px;
    height: 35px;
    margin-left: 8px;
    object-fit: contain;
    transition: var(--transition);
}

.header-logo-name:hover #saprIcon,
.header-logo-name:hover #uniIcon {
    transform: scale(1.05);
}

/* Центральная часть - навигация */
#headerCenterPart {
    flex: 1;
    display: flex;
    justify-content: center;
}

header a {
    text-decoration: none;
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
}

header a:hover {
    background: var(--light-bg);
    color: var(--accent-color);
    transform: translateY(-1px);
}

header .navigation {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

header li {
    list-style: none;
    margin: 0 2px;
}

.navigation li a {
    position: relative;
    padding: 10px 12px;
    border-radius: 4px;
    transition: var(--transition);
    white-space: nowrap;
}

.navigation li a:hover {
    background: var(--light-bg);
    color: var(--accent-color);
    transform: translateY(-1px);
}

.navigation li.active a {
    background: var(--accent-color);
    color: var(--white);
}

.menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    width: 100%;
}

/* Правая часть - переключатель языка и изображение */
#headerRightPart {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

#headerRightPart>img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    transition: var(--transition);
}

#headerRightPart>img:hover {
    transform: scale(1.05);
}

/* Переключатель языка */
#switch-lang {
    width: 90px;
    height: 32px;
    display: flex;
    justify-content: space-between;
    background: var(--light-bg);
    cursor: pointer;
    border-radius: 16px;
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    user-select: none;
}

#switch-lang:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

#switch-lang:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#switch-lang div {
    color: var(--primary-color);
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 12px;
    transition: var(--transition);
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    text-align: center;
    min-width: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

#switch-lang:hover div {
    color: var(--white);
}

#switch-lang div:not(#not-chose),
#switch-lang .lang-active {
    background: var(--accent-color);
    color: var(--white);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

#not-chose {
    color: #6c757d !important;
    opacity: 0.7;
}

/* Мобильное меню */
.menu-burger {
    display: none;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    align-items: center;
    justify-content: center;
}

.menu-burger:hover {
    background: var(--accent-color);
    color: var(--white);
    transform: scale(1.05);
}

.menu-burger-svg {
    fill: var(--primary-color);
    width: 20px;
    height: 20px;
    transition: var(--transition);
}

.menu-burger:hover .menu-burger-svg {
    fill: var(--white);
}

.closed {
    display: none;
    z-index: 0;
}

/* Адаптивность */
@media(max-width: 1170px) {
    #headerContent {
        width: 100%;
        padding: 0 20px;
    }
    
    .menu-burger {
        display: flex;
    }
    
    #headerLeftPart {
        flex: 1;
    }
    
    #headerRightPart {
        flex: 0 0 auto;
    }
    
    header .navigation {
        display: none;
    }
    
    header nav {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--white);
        box-shadow: var(--box-shadow);
        z-index: 999;
        display: none;
    }
    
    header nav a {
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid #e9ecef;
    }
    
    #switch-lang {
        margin-left: 0;
    }
    
    #headerLeftPart {
        flex: 1;
    }
    
    #headerRightPart>img {
        width: 40px;
        height: 40px;
    }
    
    .open {
        display: block;
    }
    
    #headerCenterPart nav,
    #headerCenterPart .navigation {
        display: none;
    }
    
    #headerCenterPart nav.open,
    #headerCenterPart .navigation.open {
        display: block;
    }
}

@media(max-width: 425px) {
    #uniIcon {
        width: 35px;
        height: 35px;
    }
    
    #saprIcon {
        width: 30px;
        height: 30px;
    }
    
    .header-logo-name>p {
        font-size: 10px;
        margin-left: 8px;
    }
    
    header {
        padding: 10px 0;
    }
    
    #headerContent {
        padding: 0 15px;
    }
    
    .menu-burger {
        width: 45px;
        height: 45px;
    }
    
    .menu-burger-svg {
        width: 18px;
        height: 18px;
    }
    
    #headerRightPart>img {
        width: 35px;
        height: 35px;
    }
}

/* Выпадающее меню админа */
.admin-dropdown {
    position: relative;
}

.admin-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.admin-dropdown-toggle i {
    font-size: 10px;
    transition: var(--transition);
}

.admin-dropdown:hover .admin-dropdown-toggle i {
    transform: rotate(180deg);
}

.admin-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1001;
    padding: 8px 0;
    margin-top: 5px;
}

.admin-dropdown:hover .admin-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.admin-dropdown-menu li {
    margin: 0;
    list-style: none;
}

.admin-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text-color);
    font-size: 13px;
    font-weight: 400;
    transition: var(--transition);
    border-radius: 0;
    white-space: nowrap;
}

.admin-dropdown-menu a:hover {
    background: var(--light-bg);
    color: var(--accent-color);
    transform: none;
    padding-left: 20px;
}

/* Адаптивность для выпадающего меню */
@media(max-width: 1170px) {
    .admin-dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0;
        margin: 0;
        min-width: auto;
    }
    
    .admin-dropdown-menu li {
        margin: 5px 0;
    }
    
    .admin-dropdown-menu a {
        padding: 8px 20px;
        font-size: 14px;
    }
    
    .admin-dropdown-menu a:hover {
        padding-left: 25px;
    }
    
    .admin-dropdown-toggle i {
        display: none;
    }
}