/* Базовые переменные и сброс */
:root {
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --accent-blue: #0056b3;
    --accent-hover: #004494;
    --text-main: #333333;
    --text-muted: #666666;
    --border-radius: 12px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    --bubble-mine: #dcf8c6;
    --bubble-theirs: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    overflow: hidden; /* Отключаем общий скролл, скроллиться будут только колонки */
}

.layout-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* =========================================
   СЕТКА (GRID)
   ========================================= */
.main-grid-integrated {
    display: grid;
    /* Левая панель 340px, гибкий центр, правая панель 300px */
    grid-template-columns: 340px 1fr 300px;
    gap: 24px;
    height: calc(100vh - 40px);
}

/* =========================================
   ЛЕВАЯ ПАНЕЛЬ (НАВИГАЦИЯ + ЧАТ)
   ========================================= */
.integrated-sidebar {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: var(--bg-color);
}

.sidebar-header .logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-blue);
    margin-bottom: 15px;
    text-align: center;
}
.sidebar-header .logo span { color: var(--text-main); }

.compact-nav {
    display: flex;
    gap: 10px;
}

.compact-nav a {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: 0.2s;
    font-size: 18px;
}

.compact-nav a:hover, .compact-nav a.active {
    background: var(--accent-blue);
    color: white;
}

/* Встроенный чат */
.integrated-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #e5ddd5;
    overflow: hidden;
}

.chat-header {
    padding: 10px 15px;
    background: var(--card-bg);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    z-index: 10;
}

.chat-partner-info h3 { font-size: 15px; }
.chat-partner-info .status { font-size: 12px; }
.status.online { color: #28a745; }

.messages-area {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    font-size: 14px;
}
.bubble.theirs { background: var(--bubble-theirs); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.mine { background: var(--bubble-mine); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-time { display: block; text-align: right; font-size: 10px; color: #888; margin-top: 4px; }

.chat-input-area {
    padding: 15px;
    background: var(--card-bg);
    display: flex;
    gap: 10px;
}

.msg-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}
.msg-input:focus { border-color: var(--accent-blue); }

.send-btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.send-btn:hover { background: var(--accent-hover); }

/* =========================================
   ЦЕНТР (ЛЕНТА) И ПРАВО (ВИДЖЕТЫ)
   ========================================= */
.feed-center, .sidebar-right {
    height: 100%;
    overflow-y: auto;
    padding-right: 10px; /* Для скроллбара */
}

/* Стилизация скроллбара (опционально) */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

.section-title {
    margin-bottom: 20px;
    font-size: 20px;
    color: var(--text-main);
}

.news-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.card-header { margin-bottom: 15px; }
.author-info strong { display: block; font-size: 15px; }
.author-info .date { font-size: 13px; color: var(--text-muted); }
.post-title { margin-bottom: 10px; font-size: 18px; }
.post-text { color: var(--text-main); margin-bottom: 15px; }

.widget {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.widget h3 {
    font-size: 16px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.weather-content { display: flex; align-items: center; gap: 15px; font-size: 24px; font-weight: bold;}
.weather-content img { width: 50px; height: 50px; }
.traffic-map iframe { width: 100%; height: 200px; border-radius: 8px; }

.status-indicator { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; font-weight: 500;}
.status-indicator.online .dot {
    width: 10px; height: 10px; background: #28a745; border-radius: 50%; box-shadow: 0 0 8px #28a745;
}
.stat-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px;}

/* =========================================
   АДАПТИВНОСТЬ
   ========================================= */
@media (max-width: 1024px) {
    body { overflow: auto; }
    .main-grid-integrated {
        grid-template-columns: 1fr;
        height: auto;
    }
    .integrated-sidebar { height: 500px; }
    .feed-center, .sidebar-right { height: auto; overflow-y: visible; padding-right: 0;}
}
