/* Сброс стилей */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2c3e50;
    color: white;
    width: 100%;
    padding: 20px 40px;
    flex-wrap: wrap;
    position: relative;
}

header .logo img {
    width: 100px;
}

/* Navigation */
.main-nav {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-size: 1.5em;
    font-weight: bold;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: #f39c12;
}

/* ---------------- Language Dropdown ---------------- */
.language-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.dropdown-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #2c3e50;
    color: white;
    font-weight: bold;
    padding: 5px 15px;
    border-radius: 8px;
    cursor: pointer;
}

.dropdown-display img {
    width: 30px;
    height: 20px;
}

.dropdown-menu {
    position: absolute;
    top: 120%;
    left: 0;
    background: white;
    list-style: none;
    padding: 10px 0;
    color: black;
    margin: 0;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    display: none;
    min-width: 100px;
    z-index: 10;
}

.dropdown-menu li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    cursor: pointer;
}

.dropdown-menu li img {
    width: 25px;
    height: 15px;
}

.dropdown-menu li:hover {
    background: #f1f1f1;
}

.language-dropdown:hover .dropdown-menu {
    display: block;
}

/* ---------------- Hamburger ---------------- */
#menu-checkbox {
    display: none;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    cursor: pointer;
    margin-left: 10px; /* рядом с дропдауном */
}

.menu-toggle span {
    display: block;
    height: 4px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}


/* Основной контент */
main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 95%;
    max-width: 1400px;
    padding: 50px 20px;
}

/* Секции */
section {
    margin-bottom: 80px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

section h1, section h2 {
    font-size: 3.5em;
    margin-bottom: 40px;
    color: #2c3e50;
    text-align: center;
}

/* Programming Languages (линии слева направо с отступом 20px вниз) */
.language-cards {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 50px;
}

.lang-card {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 15px 0;
    background: linear-gradient(135deg, #ffffff, #e0f7fa);
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
}

.lang-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.lang-card h3 {
    font-size: 1.5em;
    margin-right: 15px;
}

.lang-card p {
    font-size: 1.2em;
    line-height: 1.4;
    flex-grow: 1;
}
.lang-card img{
    width: 150px;
    padding: 10px;
}

/* Отступ 20px между линиями */
.language-cards > :not(:last-child) {
    margin-bottom: 20px;
}

/* Адаптивность */
@media screen and (max-width: 1200px) {
    section h1, section h2 { font-size: 3em; }
    .lang-card h3 { font-size: 1.4em; }
    .lang-card p { font-size: 1.1em; }
}
@media screen and (max-width:800px) {
    /* Скрываем стандартную навигацию */
    .main-nav {
        position: fixed;
        top: 0;
        left: -250px; /* скрыто за экраном слева */
        width: 250px;
        height: 100%;
        background-color: #2c3e50;
        flex-direction: column;
        padding: 60px 20px;
        gap: 20px;
        transition: left 0.3s ease;
        z-index: 100;
    }

    .main-nav a {
        font-size: 1.5em;
        font-weight: bold;
        color: white;
        text-decoration: none;
    }

    /* Показываем меню при чекнутом гамбургере */
    #menu-checkbox:checked + .menu-toggle + .main-nav {
        left: 0;
    }

    /* Гамбургер справа рядом с дропдауном */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 22px;
        cursor: pointer;
        margin-left: 10px; /* рядом с дропдауном */
        order: 2; /* чтобы был после дропдауна */
    }

    .menu-toggle span {
        display: block;
        height: 4px;
        background-color: white;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    /* Дропдаун языков остаётся справа */
    .language-dropdown {
        display: flex;
        align-items: center;
        gap: 10px;
        order: 1; /* перед гамбургером */
        margin-left: auto;
    }

    /* Стили для header */
    header {
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding: 10px 20px;
    }
}

@media screen and (max-width: 768px) {
    .main-nav { gap: 20px; }
    section h1, section h2 { font-size: 2.5em; }
    .lang-card { flex-direction: column; text-align: center; }
    .lang-card h3 { margin-right: 0; margin-bottom: 10px; }
}
