/* Original file */
html {
    scrollbar-width: thin;
    scrollbar-color: #125374 #646262;
    background-color: rgb(255, 255, 255);
}

body {
    margin: 0;
    padding: 0;    
    /* font-family: "Inter", sans-serif; */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 20px;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #646262;
}

::-webkit-scrollbar-thumb {
    background: #125374;
}

/* ============================================
   HEADER STYLES
   ============================================ */

/* Base header wrapper */
.header-wrapper {
    margin-top: 0;
    padding: 10px 0;
    position: fixed;
    width: 100%;
    background-color: rgb(29, 27, 32);
    backdrop-filter: blur(2px);
    top: 0;
    transition: background-color 0.3s ease-in-out;
    z-index: 1000;
    font-size: 20px;
}

/* Index page transparent header */
.header-index {
    background-color: rgba(12, 5, 29, 0.062) !important;
}

.header-index.scrolled {
    background-color: rgb(29, 27, 32) !important;
}

.header-wrapper.scrolled {
    background-color: rgb(29, 27, 32);
}

.header-wrapper.fixed {
    background-color: rgb(29, 27, 32);
}

/* Container */
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main header layout */
.header-main {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

/* Logo and brand section */
.header-brand {
    display: flex;
    align-items: center;
    justify-self: start;
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo svg,
.header-logo img {
    width: 65px;
    height: auto;
    transition: filter 0.3s ease;
}

.header-logo:hover svg,
.header-logo:hover img {
    filter: brightness(120%);
}

.class-logo {
    width: 60px;
    height: auto;
    transition: filter 0.3s ease;
}

.class-logo:hover {
    filter: brightness(120%);
}

/* Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    justify-self: center;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 25px;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 17px;
    font-weight: 500;
    padding: 5px 0;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #03abc9;
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: #03abc9;
}

.nav-link:hover:after {
    width: 100%;
}

/* Header actions (Sign in button and language selector) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-self: end;
}

.sign-in-link {
    text-decoration: none;
}

.sign-in-button {
    padding: 8px 20px;
    background-color: #03abc9;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.6s;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.sign-in-button:hover {
    filter: brightness(200%);
    background: rgba(0,0,0,0);
    color: #0477b1;
    box-shadow: inset 0 0 0 3px #3a7999;
}

/* Language selector */
.language-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.language-selector img {
    width: 20px;
    height: 20px;
}

.language-selector span {
    color: white;
    font-size: 16px;
    transition: filter 0.3s ease;
}

.language-selector:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #03abc9;
    transition: width 0.3s ease;
}

.language-selector:hover span {
    color: #03abc9;
}

.language-selector:hover img {
    filter: invert(42%) sepia(92%) saturate(376%) hue-rotate(158deg) brightness(93%) contrast(88%);
}

.language-selector:hover:after {
    width: 100%;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(18, 18, 62, 0.95);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    padding: 5px 0;
    min-width: 80px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
    margin-top: 5px;
}

.language-selector:hover .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: block;
    padding: 8px 15px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    text-align: center;
}

.language-option:hover {
    background: rgba(3, 171, 201, 0.2);
    color: #03abc9;
}

/* ============================================
   HAMBURGER MENU
   ============================================ */

.hamburger-menu {
    position: relative;
    display: none;
}

/* Скрытый чекбокс */
#menu__toggle {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

/* Анимация при открытии */
#menu__toggle:checked + .menu__btn > span {
    transform: rotate(45deg);
}

#menu__toggle:checked + .menu__btn > span::before {
    top: 0;
    transform: rotate(0deg);
}

#menu__toggle:checked + .menu__btn > span::after {
    top: 0;
    transform: rotate(90deg);
}

#menu__toggle:checked ~ .menu__box {
    left: 0 !important;
}

/* Кнопка бургер-меню */
.menu__btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    cursor: pointer;
    z-index: 1001;
}

.menu__btn > span,
.menu__btn > span::before,
.menu__btn > span::after {
    display: block;
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #fffcfc;
    transition-duration: .25s;
}

.menu__btn > span {
    top: 10px;
}

.menu__btn > span::before {
    content: '';
    top: -7px;
}

.menu__btn > span::after {
    content: '';
    top: 7px;
}

/* Выпадающее меню - на всю высоту экрана */
.menu__box {
    display: block;
    position: fixed;
    top: 0;
    left: -100%;
    width: 200px;
    height: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 80px 0;
    list-style: none;
    background-color: rgb(22, 21, 49);
    box-shadow: 2px 2px 6px rgba(0, 0, 0, .4);
    transition-duration: .25s;
    z-index: 1000;
    box-sizing: border-box;
}

.menu__box li {
    list-style: none;
}

.menu__item {
    display: block;
    padding: 12px 24px;
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s ease;
}

.menu__item:hover {
    background-color: rgba(3, 171, 201, 0.2);
    color: #03abc9;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* 900px - Show hamburger, hide item6 */
@media (max-width: 900px) {
    .nav-item.item6 {
        display: none;
    }
    
    .hamburger-menu {
        display: block;
    }
    
    /* Grid layout для центрирования с hamburger */
    .header-main {
        grid-template-columns: 1fr auto auto 1fr;
        gap: 15px;
    }
    
    .header-brand {
        grid-column: 1;
    }
    
    .header-nav {
        grid-column: 2;
        gap: 15px;
    }
    
    .header-actions {
        grid-column: 3;
        gap: 15px;
        justify-self: auto;
    }
}

/* 830px - Hide item5 */
@media (max-width: 830px) {
    .nav-item.item5 {
        display: none;
    }
}

/* 760px - Hide item4 */
@media (max-width: 760px) {
    .nav-item.item4 {
        display: none;
    }
}

/* 690px - Hide item3 */
@media (max-width: 690px) {
    .nav-item.item3 {
        display: none;
    }
}

/* 620px - Hide item2 */
@media (max-width: 620px) {
    .nav-item.item2 {
        display: none;
    }
}

/* 550px - Hide item1 (all nav items hidden) */
@media (max-width: 550px) {
    .nav-item.item1 {
        display: none;
    }
    
    .nav-list {
        display: none;
    }
}

/* Tablet adjustments */
@media (max-width: 768px) {
    .header-main {
        padding: 0 10px;
        gap: 15px;
    }
    
    .nav-list {
        gap: 15px;
    }
    
    .nav-link {
        font-size: 15px;
    }
    
    .sign-in-button {
        font-size: 14px;
        padding: 6px 14px;
    }
    
    .header-actions {
        gap: 15px;
    }
    
    .language-selector span {
        font-size: 14px;
    }
}

/* Mobile devices */
@media (max-width: 480px) {
    .header-container {
        padding: 0 15px;
    }
    
    .header-main {
        padding: 0 5px;
        gap: 12px;
    }
    
    .header-logo svg,
    .header-logo img,
    .class-logo {
        width: 50px;
    }
    
    .header-nav {
        gap: 12px;
    }
    
    .header-actions {
        gap: 12px;
    }
    
    .sign-in-button {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .language-selector span {
        font-size: 13px;
    }
    
    .language-selector img {
        width: 18px;
        height: 18px;
    }
    
    .menu__item {
        font-size: 16px;
        padding: 10px 20px;
    }
    
    .menu__btn {
        width: 20px;
        height: 20px;
    }
    
    .menu__btn > span {
        top: 9px;
    }
    
    .menu__btn > span::before {
        top: -6px;
    }
    
    .menu__btn > span::after {
        top: 6px;
    }
}

/* Very small devices */
@media (max-width: 360px) {
    .header-main {
        gap: 10px;
    }
    
    .header-logo svg,
    .header-logo img,
    .class-logo {
        width: 45px;
    }
    
    .sign-in-button {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .language-selector span {
        display: none;
    }
    
    .header-nav {
        gap: 10px;
    }
    
    .header-actions {
        gap: 10px;
    }
    
    .menu__btn {
        width: 18px;
        height: 18px;
    }
    
    .menu__btn > span {
        top: 8px;
    }
    
    .menu__btn > span::before {
        top: -5px;
    }
    
    .menu__btn > span::after {
        top: 5px;
    }
}