/* Стили для шапки header.php */

/* ============================= */
/* Цветовые переменные для шапки */
/* ============================= */

header {
    --primary-color: #5d5d5d;
    --secondary-color: #f8f9fa;
    --text-color: #5d5d5d; /* Цвет текста для основного меню */
    --menu-text-hover: #black; /* Цвет текста при наведении в основном меню */
    --auth-color: #bcc8e9;
    --auth-hover: #bcc8e9;
    --auth-secondary: #d0d0d0;

    /* Цвета текста */
    --auth-text: black; /* Цвет текста кнопки "Войти" */
    --auth-text-hover: white; /* Цвет текста кнопки "Войти" при наведении */
    --auth-text-reg: white; /* Цвет текста кнопки "Регистрация" */
    --transition: all 0.3s ease;
    --auth-btn-text: white; /* Общий цвет текста для обеих кнопок */

    /* Шрифты */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar {
    background: #ffffff;;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-icon {
    margin-right: 0.5rem;
    font-size: 2rem;
}

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
}

.nav-links li {
    margin: 0 0.8rem;
    position: relative;
}

/* Стили для ссылок основного меню */
.nav-links > li > a {
    text-decoration: none;
    color: var(--text-color);         /* Применяем основной цвет текста */
    font-weight: 500;
    font-size: 1.5rem;
    transition: var(--transition);
    padding: 0.5rem 0;
}

.nav-links > li > a:hover {
    color: var(--menu-text-hover);    /* Цвет при наведении в основном меню */
}

.nav-links > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-links > li > a:hover::after {
    width: 100%;
}

/* Блок кнопок авторизации */
.auth-buttons {
    display: flex;
    align-items: center;
    margin-left: 2rem;
    position: relative;
}

.auth-buttons::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 1px;
    background: #ddd;
}

/* Общие стили для кнопок авторизации */
.auth-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    margin-left: 0.8rem;
    font-size: 1.2rem;
    border: none; /* Убираем рамку у всех кнопок */
    color: var(--auth-btn-text); /* Общий цвет текста */
}

/* Конкретные стили для кнопок */
.login {
    background: var(--auth-secondary);
    color: var(--auth-text);          /* Синий текст для "Войти" */
    border: none; /* Добавьте эту строку */
}

.login:hover {
    background: var(--primary-color);
    color: var(--auth-text-hover);    /* Белый текст при наведении */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2);
}

.register {
    background: var(--primary-color);
    color: var(--auth-text-reg);      /* Белый текст для "Регистрация" */
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.1);
}

.register:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.15);
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.8rem;
    color: var(--primary-color);
}

/* Адаптивность */
@media (max-width: 992px) {
    .navbar {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        width: 100%; /* Добавьте это */
    }

    .nav-header {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 1rem; /* отступы по бокам */
        margin: 0; /* нет внешних отступов */
        box-sizing: border-box; /* Учитываем padding в ширине */
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        display: none;
        padding-top: 1rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin: 0.5rem 0;
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        display: block;

    }

    .auth-buttons {
        margin: 1rem 0 0 0;
        width: 100%;
        justify-content: center;
        padding-top: 1rem;
        border-top: 1px solid #eee;
    }

    .auth-buttons::before {
        display: none;
    }

    .hamburger {
        display: block;
    }
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-links li {
    animation: fadeIn 0.5s ease forwards;
}

.nav-links li:nth-child(1) { animation-delay: 0.1s; }
.nav-links li:nth-child(2) { animation-delay: 0.2s; }
.nav-links li:nth-child(3) { animation-delay: 0.3s; }
.nav-links li:nth-child(4) { animation-delay: 0.4s; }
.auth-buttons { animation: fadeIn 0.5s ease 0.5s forwards; opacity: 0; }

        
        body {
            font-family: Arial, sans-serif;
        }
        
        .header {
            width: 100%;
            padding: 20px;
            background-color: #f8f8f8;
            display: flex;
            justify-content: center;
            align-items: center;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        
        .logo-wrapper {
            position: relative;
            max-width: 100%;
        }
        
        .logo-img {
            max-width: 200px;
            height: auto;
            display: block;
        }
        
        .logo-text {
            display: none;
            font-size: 24px;
            font-weight: bold;
            color: #333;
            padding: 10px 20px;
            background-color: #eee;
            border-radius: 4px;
        }
        
        /* Если изображение не загрузилось, показываем текст */
        .logo-img[src=""] + .logo-text,
        .logo-img:not([src]) + .logo-text,
        .logo-img[src*="undefined"] + .logo-text,
        .logo-img[src*="null"] + .logo-text {
            display: block;
        }
        
        /* Стили для разных размеров экрана */
        @media (max-width: 768px) {
            .header {
                padding: 15px;
            }
            .logo-text {
                font-size: 20px;
            }
        }
        
        @media (max-width: 480px) {
            .header {
                padding: 10px;
            }
            .logo-text {
                font-size: 18px;
                padding: 8px 16px;
            }
        }
/* Стили мессенджера */
.messenger-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.chat-wrapper {
    display: flex;
    height: 70vh;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.chat-list {
    width: 300px;
    border-right: 1px solid #ddd;
    background: #f9f9f9;
    overflow-y: auto;
}

.chat-list h3 {
    padding: 15px;
    margin: 0;
    border-bottom: 1px solid #ddd;
}

.chat-item {
    display: flex;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-item:hover {
    background: #eee;
}

.chat-item.active {
    background: #e0e0e0;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #4a6fa5;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-preview {
    font-size: 0.9em;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid #ddd;
}

.messages-container {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #fff;
}

.message {
    margin-bottom: 15px;
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
}

.user-message {
    margin-left: auto;
    background: #dcf8c6;
    border-top-right-radius: 0;
}

.bot-message {
    background: #f1f0f0;
    border-top-left-radius: 0;
}

.message-content p {
    margin: 0;
}

.message-time {
    font-size: 0.7em;
    color: #999;
    text-align: right;
    margin-top: 5px;
}

.message-input {
    padding: 15px;
    border-top: 1px solid #ddd;
    background: #f9f9f9;
}

.message-input form {
    display: flex;
}

.message-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

.message-input button {
    margin-left: 10px;
    padding: 10px 20px;
    background: #4a6fa5;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

.message-input button:hover {
    background: #3a5a80;
}