body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}
header {
    background-color: #1a2b4c;
    color: white;
    text-align: center;
    padding: 20px;
    position: relative;
}
.language-switcher {
    position: absolute;
    top: 15px;
    right: 15px;
}
.language-switcher select {
    padding: 8px;
    font-size: 16px;
    border-radius: 4px;
}
nav {
    background-color: #34495e;
    padding: 10px;
    text-align: center;
}
nav a {
    color: white;
    margin: 0 15px;
    text-decoration: none;
    font-size: 18px;
}
nav a:hover {
    text-decoration: underline;
}
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    display: grid;
    gap: 20px;
}
.news, .videos {
    margin-bottom: 40px;
}
.news-item {
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}
.news-logo {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
}
.news-content {
    flex-grow: 1;
    padding-right: 120px;
}
.news-content h3 {
    margin: 0 0 5px;
}
.news-content p {
    margin: 0 0 5px;
    font-size: 13.6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.news-item .source {
    font-style: italic;
    color: #666;
    font-size: 0.9em;
    display: block;
}
.news-link {
    background-color: #2980b9;
    color: white;
    border: none;
    border-radius: 15px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}
.news-link:hover {
    background-color: #3498db;
}
.video-container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.video-item {
    flex: 1;
    min-width: 300px;
}
.video-item iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}
.load-more {
    display: block;
    margin: 20px auto;
    padding: 12px 25px;
    background-color: #2980b9;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}
.load-more:hover {
    background-color: #3498db;
}
.channel-links {
    text-align: center;
    margin: 20px 0;
}
.channel-btn {
    padding: 12px 25px;
    background-color: #2980b9;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 0 10px;
}
.channel-btn:hover {
    background-color: #3498db;
}
footer {
    text-align: center;
    padding: 15px;
    background-color: #1a2b4c;
    color: white;
    width: 100%;
    position: relative;
    z-index: 1;
}
.logbooks {
    margin-bottom: 40px;
}
#logbook-entries {
    display: block; /* По умолчанию для мобильных */
}
.logbook-item {
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px; /* Отступ для мобильных */
}
.logbook-item img {
    max-width: 100%;
    height: auto;
    margin-top: 10px;
}
.logbook-info {
    text-align: center;
    margin: 20px 0;
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Полупрозрачный фон */
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-content {
    position: relative;
    background: white;
    padding: 20px;
    border-radius: 5px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease; /* Плавное изменение цвета фона */
}
.modal-content.success {
    background-color: rgba(40, 167, 69, 0.1); /* Слегка зелёный фон при успехе */
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}
.modal-close:hover {
    color: #ff0000;
}
.auth-form {
    margin: 0; /* Убираем отступы, чтобы форма занимала всё место */
}
.auth-form .form-group {
    margin-bottom: 15px;
}
.auth-form label {
    display: block;
    margin-bottom: 5px;
}
.auth-form input {
    width: 100%; /* Поля на всю ширину */
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.auth-form button {
    padding: 10px 20px;
    background-color: #2980b9;
    color: white;
    border: none;
    border-radius: 15px; /* Закруглённые углы */
    cursor: pointer;
    float: right; /* Кнопка справа */
}
.auth-form button:hover {
    background-color: #3498db;
}
.success-checkmark {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 50px;
    color: #28a745;
    animation: checkmark-appear 0.5s ease forwards;
}
@keyframes checkmark-appear {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.logbook-form {
    width: 100%;
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.logbook-form .form-group {
    margin-bottom: 15px;
}
.logbook-form label {
    display: block;
    margin-bottom: 5px;
}
.logbook-form input[type="text"],
.logbook-form textarea {
    width: 100%; /* Поля на всю ширину */
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 8px; /* Скруглённые края */
}
.logbook-form textarea {
    resize: vertical; /* Разрешаем изменять только высоту */
}
.logbook-form button {
    padding: 10px 20px;
    background-color: #2980b9;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.logbook-form button:hover {
    background-color: #3498db;
}
.logbook-form .file-input-wrapper {
    position: relative;
    display: inline-block;
}
.logbook-form .file-input-wrapper input[type="file"] {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
}
.logbook-form .file-input-wrapper .custom-file-button {
    padding: 8px 15px;
    background-color: #2980b9;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: inline-block;
}
.logbook-form .file-input-wrapper .custom-file-button:hover {
    background-color: #3498db;
}
.file-count {
    display: block;
    margin-top: 5px;
    font-size: 14px;
    color: #666;
}
.preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.preview-item {
    position: relative;
    width: 100px;
    height: 100px;
}
.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}
.preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
}
.preview-item .remove-btn:hover {
    background: rgba(255, 0, 0, 1);
}
@media (min-width: 769px) {
    .contact-form {
        max-width: 350px;
        margin: 20px 20px 20px auto;
    }
    #logbook-entries {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* Три колонки */
        gap: 20px;
        width: 100%; /* Занимает всю ширину */
    }
    .logbook-item {
        margin-bottom: 0; /* Убираем отступ снизу в сетке */
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* Контент начинается сверху */
        min-height: 0; /* Предотвращаем излишнее растяжение */
    }
    .logbook-info {
        margin-top: 20px;
        width: 100%; /* Занимает всю ширину */
    }
    .logbook-form {
        width: 100%; /* Форма на всю ширину */
        margin: 20px 0;
        box-sizing: border-box; /* Учитываем padding в ширине */
    }
    .logbook-form, .logbook-item {
        padding: 15px; /* Одинаковый padding */
        margin-left: 0; /* Убираем лишние отступы */
        margin-right: 0;
        width: calc(100% - 30px - 40px / 3); /* Учитываем padding и gap сетки (20px на 3 колонки) */
    }
}
@media (max-width: 768px) {
    header { padding: 15px; }
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
    .language-switcher { top: 10px; right: 10px; }
    .language-switcher select { font-size: 14px; padding: 6px; }
    nav a { display: block; margin: 10px 0; font-size: 16px; }
    .container { padding: 0 10px; margin: 10px auto; }
    .news-item { padding: 10px; flex-direction: column; align-items: flex-start; }
    .news-logo { width: 60px; height: 60px; }
    .news-link { position: static; transform: none; margin-top: 10px; }
    .news-content { padding-right: 0; }
    .video-container { flex-direction: column; gap: 10px; }
    .video-item { min-width: 100%; }
    .load-more, .channel-btn { padding: 10px 20px; font-size: 14px; }
    footer { padding: 10px; position: static; }
    #logbook-entries {
        display: block; /* На мобильных вертикально */
    }
    .logbook-item {
        margin-bottom: 20px; /* Отступ между записями */
    }
}
@media (max-width: 480px) {
    h1 { font-size: 20px; }
    h2 { font-size: 18px; }
    h3 { font-size: 16px; }
    p { font-size: 14px; }
    .language-switcher { position: static; margin: 10px auto; display: block; text-align: center; }
    nav { padding: 5px; }
    .container { gap: 10px; }
    .news-item .source { font-size: 0.8em; }
}