/* Шапка сайта */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    font-family: Arial, sans-serif;
}

/* Логотип / Название слева */
.header-left h2 a {
    text-decoration: none;
    color: #333;
}

/* Навигационное меню по центру */
.navbar {
    display: flex;
    gap: 75px;

}

.navbar span a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.navbar span a:hover {
    color: #007bff;
}

/* Правый блок с логином или username */
.header-right {
    position: relative;
    display: flex;
    align-items: center;
}

/* Кнопка Войти */
.login-btn {
    background-color: #007bff;
    color: white;
    padding: 8px 14px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s;
}

.login-btn:hover {
    background-color: #0056b3;
}

/* Username с выпадающим меню */
.user-dropdown {
    position: relative;
    cursor: pointer;
}

.username {
    font-weight: 600;
    color: #333;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.username:hover {
    background-color: #f0f0f0;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 1;
    border-radius: 6px;
    margin-top: 5px;
    overflow: hidden;
}

.dropdown-content a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
}

.dropdown-content a:hover {
    background-color: #f5f5f5;
}

.show {
    display: block;
}

/* Адаптивность */
@media (max-width: 768px) {
    .top-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .navbar {
        flex-wrap: wrap;
        gap: 15px;
    }

    .header-right {
        align-self: flex-end;
    }
}


/* Затемнение фона */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

/* Контент окна */
.modal-content {
    background-color: #fff;
    padding: 30px 25px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    position: relative;
    color: #111;
    animation: fadeIn 0.3s ease;
}

.modal-title {
    margin-top: 0;
    text-align: center;
    font-size: 22px;
    color: #111;
}

/* Анимация появления */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Закрытие */
.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    color: #888;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Форма */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-form label {
    font-weight: 500;
    margin-bottom: 4px;
    color: #333;
}

.modal-form input {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    outline: none;
    font-size: 16px;
    transition: border 0.2s ease;
}

.modal-form input:focus {
    border-color: #4f46e5;
}

/* Кнопка */
.modal-button {
    margin-top: 10px;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background-color: #4f46e5;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.modal-button:hover {
    background-color: #4338ca;
}

.error-message {
    margin-top: 8px;
    color: red;
    font-size: 14px;
    text-align: center;
}

