/* css/style.css */

/* Переменные CSS */
:root {
    --primary-color: #4a4a7d;
    --secondary-color: #7d4a7d;
    --background-color: #f0f0f5;
    --text-color: #333;
    --accent-color: #9d7d9d;
}

/* Общие стили */
body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
}

/* Контейнер */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Заголовок */
header {
    background-color: var(--primary-color);
    color: white;
}

nav ul {
    list-style-type: none;
    display: flex; /* Используем flex для горизонтального расположения */
    justify-content: center; /* Центрируем элементы */
    flex-wrap: wrap; /* Позволяем элементам переноситься при необходимости */
    padding: 1rem 0;
    margin: 0;
}

nav ul li {
    margin: 0 10px; /* Добавили горизонтальные отступы между элементами */
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: var(--accent-color);
}

/* Дополнительные стили для мобильных устройств */
@media (max-width: 600px) {
    nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    nav ul li {
        margin: 5px 0;
    }
}

/* Герой-секция */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    animation: float 6s ease-in-out infinite;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Анимация плавающего текста */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Секция экспертов */
.experts-section {
    padding: 4rem 0;
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

.category-filter a {
    margin: 0.25rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.category-filter a.active,
.category-filter a:hover {
    background-color: var(--secondary-color);
}

.experts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.expert-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    text-align: center;
}

.expert-card:hover {
    transform: translateY(-5px);
}

.expert-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 1rem auto 0;
    border: 5px solid var(--accent-color);
}

.expert-info {
    padding: 1rem;
}

.expert-name {
    font-weight: bold;
    margin: 0;
}

.expert-specialty {
    color: var(--accent-color);
    margin: 0.5rem 0;
}

.expert-short-description {
    font-size: 0.9rem;
    margin: 0.5rem 0;
    color: #666;
}

.expert-price {
    font-size: 1rem;
    color: #e74c3c; /* Красный цвет */
    margin: 0.5rem 0;
}

.expert-price span {
    font-weight: bold;
}

.expert-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-online {
    background-color: #4CAF50;
    color: white;
}

.status-offline {
    background-color: #9e9e9e;
    color: white;
}

/* Кнопка чата */
.chat-button {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: 1rem;
    transition: background 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.chat-button:hover {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
}

/* Страница профиля эксперта */
.expert-detail {
    display: flex;
    flex-wrap: wrap;
    margin-top: 2rem;
    align-items: flex-start;
}

.expert-image-container {
    flex: 1 1 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.expert-image-large {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--accent-color);
    max-width: 100%;
}

.expert-info {
    flex: 2 1 500px;
    padding-left: 2rem;
}

.expert-info h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.expert-info .expert-specialty {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.expert-description {
    font-size: 1rem;
    line-height: 1.6;
    margin-top: 1rem;
}

.expert-description p {
    margin-bottom: 1rem;
}

/* Стиль для раздела "Тарифи" в профиле эксперта */
.expert-tariff {
    margin-top: 1.5rem;
}

.expert-tariff h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.expert-tariff p {
    font-size: 1.2rem;
    color: #e74c3c; /* Красный цвет */
}

.expert-tariff span {
    font-weight: bold;
}

/* Адаптивный дизайн */
@media (max-width: 768px) {
    .expert-detail {
        flex-direction: column;
        align-items: center;
    }

    .expert-info {
        padding-left: 0;
        text-align: center;
    }

    .chat-button {
        width: 80%;
        margin: 1.5rem auto 0;
    }

    .expert-info h1 {
        font-size: 1.8rem;
    }

    .expert-info .expert-specialty {
        font-size: 1.1rem;
    }

    .expert-description {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .expert-info h1 {
        font-size: 1.5rem;
    }

    .expert-info .expert-specialty {
        font-size: 1rem;
    }

    .expert-description {
        font-size: 0.9rem;
    }
}

/* Стили для чата */
.chat-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 90vh;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
}

.chat-header .expert-avatar {
    width: 40px; /* Уменьшили размер аватарки */
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.chat-header .expert-info {
    flex: 1;
}

.chat-header .expert-info h2 {
    font-size: 1.2rem; /* Уменьшили размер шрифта */
    margin: 0;
}

.chat-header .expert-info p {
    font-size: 0.9rem; /* Уменьшили размер шрифта */
    margin: 0;
    color: #ddd;
}

.chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

.chat-message {
    margin-bottom: 15px;
}

.message-client {
    text-align: right;
}

.message-expert {
    text-align: left;
}

.chat-message .message-time {
    font-size: 0.8rem;
    color: #999;
    display: block;
    margin-bottom: 5px;
}

.chat-message p {
    display: inline-block;
    padding: 10px;
    border-radius: 10px;
    max-width: 80%;
}

.message-client p {
    background-color: var(--primary-color);
    color: white;
}

.message-expert p {
    background-color: #e0e0e0;
}

/* Стили для формы ввода в чате */
.chat-input {
    padding: 10px;
    background-color: #e9e9e9;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.chat-input label.attach-button {
    cursor: pointer;
    margin-right: 10px;
    color: var(--accent-color);
    font-size: 1.5rem;
}

.chat-input input[type="file"] {
    display: none;
}

.chat-input textarea {
    flex: 1;
    resize: none;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 25px;
    margin-right: 10px;
    font-size: 1rem;
}

.chat-input button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input button i {
    margin: 0;
}

/* Адаптивность формы чата */
@media (max-width: 600px) {
    .chat-input {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-input label.attach-button {
        margin-bottom: 10px;
    }

    .chat-input textarea {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .chat-input button {
        width: 100%;
        border-radius: 25px;
    }
}

/* Анимация звезд */
.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.star {
    position: absolute;
    background-color: white;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle 4s infinite;
}

@keyframes twinkle {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}