/* ===== Базовые стили ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-image: url('bg.gif');
    background-size: cover;
    font-family: 'MS Sans Serif', 'Microsoft Sans Serif', Arial, sans-serif;
    font-size: 16px;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== Окно ===== */
.window {
    background: #c0c0c0;
    border: 3px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    box-shadow: 1px 1px 0 #dfdfdf;
    width: 950px;
    max-width: 95vw;
    height: 750px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    font-size: 12px;
    position: relative; /* для позиционирования кнопки-гамбургера */
}

/* ===== Заголовок окна ===== */
.window-title {
    background: #000080;
    color: #ffffff;
    padding: 4px 6px;
    font-weight: bold;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    user-select: none;
}
.window-title .title-text {
    display: flex;
    align-items: center;
    gap: 6px;
}
.window-title .title-text .icon {
    font-size: 16px;
    line-height: 1;
}
.window-controls {
    display: flex;
    gap: 4px;
}
.window-controls button {
    background: #c0c0c0;
    border: 2px solid #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    line-height: 14px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    color: #000;
}
.window-controls button:active {
    border: 2px solid #808080;
    border-right-color: #ffffff;
    border-bottom-color: #ffffff;
}
.window-controls .close-btn:active {
    background: #800000;
    color: #fff;
}

/* ===== Кнопка-гамбургер (показывается только на мобильных) ===== */
.menu-toggle {
    display: none; /* скрыта на десктопе */
    background: #c0c0c0;
    border: 2px solid #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    width: 28px;
    height: 28px;
    font-size: 18px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    color: #000;
    padding: 0;
    margin-right: 6px;
}
.menu-toggle:active {
    border: 2px solid #808080;
    border-right-color: #ffffff;
    border-bottom-color: #ffffff;
}

/* ===== Тело окна ===== */
.window-body {
    background: #ffffff;
    border: 2px inset #dfdfdf;
    flex: 1;
    margin: 4px;
    padding: 0;
    display: flex;
    overflow: hidden;
    position: relative; /* для позиционирования панели на мобильных */
}

/* ===== Панель навигации ===== */
.sidebar {
    width: 200px;
    flex-shrink: 0;
    background: #c0c0c0;
    border-right: 2px solid #808080;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar-title {
    background: #000080;
    color: #ffffff;
    padding: 3px 6px;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    margin-bottom: 4px;
}

.nav-btn {
    background: #c0c0c0;
    border: 2px solid #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    padding: 5px 8px;
    font-family: inherit;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
    color: #000;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-btn:active {
    border: 2px solid #808080;
    border-right-color: #ffffff;
    border-bottom-color: #ffffff;
}
.nav-btn:hover {
    background: #000080;
    color: #ffffff;
}
.nav-btn.active {
    background: #000080;
    color: #ffffff;
    border: 2px solid #808080;
    border-right-color: #ffffff;
    border-bottom-color: #ffffff;
}
.nav-btn .icon {
    font-size: 18px;
    line-height: 1;
}
.separator {
    border-top: 1px solid #808080;
    border-bottom: 1px solid #ffffff;
    margin: 4px 0;
}

/* ===== Основное содержимое ===== */
.main-content {
    flex: 1;
    padding: 16px;
    background: #ffffff;
    overflow-y: auto;
    height: 100%;
    font-size: 16px;
}

/* ===== Статусная строка ===== */
.window-status {
    background: #c0c0c0;
    border-top: 2px solid #dfdfdf;
    border-bottom: 2px solid #808080;
    padding: 2px 8px;
    font-size: 11px;
    color: #000;
    display: flex;
    gap: 20px;
    flex-shrink: 0;
    margin: 0 4px 4px 4px;
}

/* ===== Общие элементы ===== */
.btn {
    background: #c0c0c0;
    border: 2px solid #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    padding: 4px 16px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    color: #000;
}
.btn:active {
    border: 2px solid #808080;
    border-right-color: #ffffff;
    border-bottom-color: #ffffff;
}
.btn-primary {
    background: #000080;
    color: #ffffff;
    border-color: #ffffff #808080 #808080 #ffffff;
}
.input {
    background: #ffffff;
    border: 2px inset #dfdfdf;
    padding: 2px 4px;
    font-family: inherit;
    font-size: 12px;
    color: #000;
    outline: none;
}
.input:focus {
    border-color: #000080;
}
.checkbox, .radio {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.checkbox input, .radio input {
    margin: 0;
    width: 14px;
    height: 14px;
    accent-color: #000080;
}
.panel-raised {
    border: 2px solid #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    background: #c0c0c0;
    padding: 4px;
}
.panel-sunken {
    border: 2px inset #dfdfdf;
    background: #ffffff;
    padding: 4px;
}

.post{
    border: 2px inset #dfdfdf;
    background: #ffffff;
    padding: 4px;
}

.image{
    border: 2px inset #dfdfdf;
    background: #ffffff;
    padding: 4px;
    cursor: pointer;
    
}

.date{
  font-size: 12px;
  font-style: italic;
}

/* ============================================================ */
/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ (ширина ≤ 768px) ===== */
@media (max-width: 768px) {
    .window {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-width: 2px;
    }

    /* Показываем кнопку-гамбургер */
    .menu-toggle {
        display: inline-block;
    }

    /* Панель по умолчанию скрыта (сдвинута влево) */
    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: 250px;
        z-index: 10;
        border-right: 2px solid #808080;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        background: #c0c0c0;
        box-shadow: 2px 0 8px rgba(0,0,0,0.3);
    }

    /* Когда открыто — панель заезжает */
    .window-body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    /* Затемнение фона при открытом меню (опционально) */
    .window-body.sidebar-open::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.3);
        z-index: 5;
        pointer-events: none; /* чтобы клики проходили сквозь на контент */
    }

    /* Основное содержимое занимает всю ширину */
    .main-content {
        padding: 12px;
    }

    /* Статусная строка: убираем лишние элементы */
    .window-status span:not(:first-child) {
        display: none;
    }
    
    .panel-sunken {
      background: #ffffff;
      border: 2px solid;
      border-color: #808080 #ffffff #ffffff #808080;
      padding: 8px;
    }
}