:root {
    --bg-main: #f0f4f8;
    /* Очень светлый серо-голубой */
    --glass-cloud: rgba(255, 255, 255, 0.75);
    /* Полупрозрачное белое облако */
    --glass-border: rgba(255, 255, 255, 0.6);
    --shadow-cloud: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 0 20px rgba(255, 255, 255, 0.5) inset;

    --accent: #6366f1;
    /* Indigo */
    --accent-hover: #4f46e5;
    --text-primary: #1e293b;
    --text-secondary: #64748b;

    --chat-ai-bg: #ffffff;
    --chat-user-bg: #6366f1;
    --chat-user-text: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-main);
    background-image:
        radial-gradient(at 10% 10%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(236, 72, 153, 0.08) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Основной контейнер */
.app-container {
    display: flex;
    width: 95%;
    max-width: 1500px;
    height: 90vh;
    gap: 30px;
}

/* === ЛЕВАЯ ЧАСТЬ: ЧАТ-ОБЛАКО === */
.chat-section {
    flex: 2;
    /* Занимает 2 части ширины */
    background: var(--glass-cloud);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    box-shadow: var(--shadow-cloud);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    /* Анимация появления */
    animation: floatUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes floatUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Заголовок чата */
.chat-header {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.status-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Окно сообщений */
.chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Сообщения */
.message {
    max-width: 80%;
    padding: 16px 24px;
    border-radius: 20px;
    line-height: 1.6;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    animation: msgPop 0.3s ease;
}

@keyframes msgPop {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.msg-ai {
    align-self: flex-start;
    background: var(--chat-ai-bg);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.msg-user {
    align-self: flex-end;
    background: var(--chat-user-bg);
    color: var(--chat-user-text);
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

/* Поле ввода (Fix: теперь оно точно видно) */
.input-area {
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.4);
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    display: flex;
    gap: 15px;
    align-items: center;
}

.chat-input-wrapper {
    flex: 1;
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    padding: 5px 15px;
    border: 1px solid transparent;
    transition: 0.2s;
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 4px 25px rgba(99, 102, 241, 0.15);
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 14px 0;
    font-size: 1rem;
    color: var(--text-primary);
    min-height: 24px;
    /* Fix heights */
}

.send-btn {
    background: var(--accent);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* === ПРАВАЯ ЧАСТЬ: ЖИВАЯ СТЕНА === */
.wall-section {
    flex: 1;
    /* Уже чем чат (1 vs 2) */
    background: rgba(255, 255, 255, 0.5);
    /* Более прозрачный */
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wall-header {
    padding: 20px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.wall-feed {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Скроллбар для эстетики */
.wall-feed::-webkit-scrollbar {
    width: 4px;
}

.wall-feed::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.post-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

.post-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.post-content {
    padding: 16px;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.platform-tag {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.text-tg {
    color: #229ED9;
}

.text-ig {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-yt {
    color: #FF0000;
}

.text-fb {
    color: #1877F2;
}

.text-wa {
    color: #25D366;
}

.post-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Мобильная версия */
@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
        height: 100vh;
        width: 100%;
        border-radius: 0;
        gap: 0;
    }

    .chat-section,
    .wall-section {
        border-radius: 0;
        border: none;
    }

    .chat-section {
        flex: 2;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.9);
    }

    .wall-section {
        flex: 1;
        display: none;
        /* Скрываем стену на телефоне пока */
    }
}