/* --- ОСНОВНЫЕ СТИЛИ СТРАНИЦЫ --- */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
    /* Уходим от красных оттенков в более глубокий синий/черный */
    background: radial-gradient(circle at center, #0a1931, #000000);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: white !important;
}

/* --- ШАПКА (Glass Header) --- */
.glass-header {
    width: 100%;
    height: 60px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    z-index: 1000;
}

    .glass-header h1 {
        letter-spacing: 5px;
        font-size: 1.4rem;
        margin-left: 20px;
        font-weight: 900;
        text-shadow: 0 0 15px rgba(0, 86, 255, 0.5);
    }

/* --- СЕТКА ПРИЛОЖЕНИЯ (Layout) --- */
.feed-layout {
    display: flex;
    width: 98%;
    max-width: 1400px;
    margin: 75px auto 0;
    gap: 20px;
    height: calc(100vh - 90px);
    z-index: 10;
}

/* --- БОКОВОЕ МЕНЮ --- */
.side-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 220px;
    min-width: 220px;
}

.menu-item {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 18px;
    border-radius: 15px;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.8);
}

    .menu-item:hover {
        background: rgba(255, 255, 255, 0.12);
        transform: translateX(8px);
    }

    .menu-item.active {
        background: rgba(0, 86, 255, 0.6);
        border: 1px solid rgba(0, 86, 255, 0.8);
        box-shadow: 0 0 20px rgba(0, 86, 255, 0.3);
    }

/* --- ОСНОВНОЙ КОНТЕНТ --- */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    display: flex;
    flex-direction: column;
}

    /* Скроллбар */
    .main-content::-webkit-scrollbar, .chats-sidebar::-webkit-scrollbar, #messages-list::-webkit-scrollbar {
        width: 5px;
    }

    .main-content::-webkit-scrollbar-thumb, #messages-list::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 10px;
    }

/* --- ГЛАСС-КАРТОЧКИ (Посты, Профиль, Чат) --- */
.post-card, .friends-block, .profile-header, .messenger-container {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.post-card {
    padding: 20px;
    margin-bottom: 20px;
}

/* --- МЕССЕНДЖЕР (Исправленная верстка) --- */
.chat-container {
    display: flex;
    flex: 1;
    height: 100%;
    overflow: hidden;
    border-radius: 25px;
    background: rgba(0, 0, 0, 0.2);
}

.chats-sidebar {
    width: 320px;
    min-width: 320px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
}

/* Элемент списка чатов */
.chat-item {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: 0.2s;
}

    .chat-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }

    .chat-item.active {
        background: rgba(0, 86, 255, 0.15);
        border-left: 4px solid #0056ff;
    }

/* Сообщения */
#messages-list {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg {
    max-width: 70%;
    padding: 10px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
}

    .msg.sent {
        align-self: flex-end;
        background: rgba(0, 86, 255, 0.85);
        border-bottom-right-radius: 4px;
    }

    .msg.received {
        align-self: flex-start;
        background: rgba(255, 255, 255, 0.1);
        border-bottom-left-radius: 4px;
    }

/* Поле ввода */
.chat-input-area {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
}

/* --- ИНПУТЫ --- */
input[type="text"], input[type="password"], textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 15px;
    border-radius: 12px;
    outline: none;
    transition: 0.2s;
}

input:focus {
    border-color: #0056ff;
    background: rgba(255, 255, 255, 0.1);
}

.send-btn {
    background: #0056ff;
    border: none;
    padding: 0 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

    .send-btn:hover {
        transform: scale(1.05);
        background: #0046d5;
    }

/* --- ПАНЕЛЬ НАСТРОЕК (Glass Edit) --- */
.edit-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 25, 40, 0.8) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px);
    padding: 30px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    z-index: 9999;
    width: 350px;
}

    .edit-panel h3 {
        margin: 0 0 20px;
        text-align: center;
        color: white !important;
    }

    .edit-panel input {
        width: 100%;
        margin-bottom: 10px;
    }

/* --- АВТОРИЗАЦИЯ (Если нужна белая) --- */
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    color: black;
    width: 380px;
    margin: 100px auto;
    padding: 40px;
    text-align: center;
    border-radius: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

    .auth-card input {
        background: #f0f0f0;
        color: black;
        border: 1px solid #ddd;
    }

/* Уведомления */
.notification-dot {
    width: 10px;
    height: 10px;
    background: #ff4444;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #ff4444;
}

/* Анимированный фон (иконки) */
#icon-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* style.css Дополнение */
.post-card, .profile-header, .friends-block, .main-content > div {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(15px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

/* Убедись, что в profile.html нет JS строк вроде card.style.background = 'white' */