/* === Общие стили сайта === */
body {
    background-color: #e8f0ec;
    color: #333333;
    font-family: "Segoe UI", Roboto, sans-serif;
}

/* === Верхнее меню === */
#header {
    background-color: #4b7058;
    color: #ffffff;
    border: none;
    background-image: url("../images/header4_sm4.png");
    background-repeat: repeat;
    background-size: auto;
    background-position: top left;
}

/* === ОСНОВНОЕ МЕНЮ В САЙДБАРЕ === */
#nav ul.menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

#nav ul.menu li a {
    display: block;
    padding: 6px 16px;
    margin: 6px 8px;
    border-radius: 8px;
    color: #2e805f;
    font-size: 1.05em;
    font-weight: 500;
    text-decoration: none;
    background-color: transparent;
    border-left: 4px solid transparent;
    transition: all 0.25s ease;
}

#nav ul.menu li a:hover {
    background-color: rgba(46, 128, 95, 0.1);
    color: #1f6a4a;
    border-left-color: #19bb54;
    padding-left: 20px;
    text-decoration: none;
}

#nav ul.menu li.current > a {
    background-color: rgba(46, 128, 95, 0.15);
    color: #1f6a4a;
    font-weight: 600;
    border-left-color: #19bb54;
}

#nav ul.menu ul li a {
    padding-left: 32px;
    font-size: 0.95em;
    border-left-color: transparent;
    background-color: transparent;
}

#nav ul.menu ul li a:hover {
    padding-left: 36px;
}

#nav ul.menu li a,
#nav ul.menu li:last-child a {
    border-bottom: none;
    box-shadow: none;
}

/* === Контентная зона === */
#content {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
}

/* === Заголовки === */
h1, h2, h3, h4 {
    color: #2e805f;
}

/* === Ссылки внутри контента === */
#content a,
.contentpaneopen a,
.item-page a,
.article-body a {
    color: #2e805f;
    text-decoration: underline;
}

#content a:hover,
.contentpaneopen a:hover,
.item-page a:hover,
.article-body a:hover {
    color: #3a9d75;
    text-decoration: none;
}

/* === Ссылки в шапке === */
#header a,
#logo a,
#header .fontsize a {
    color: #fbfffd !important;
}

#header a:hover,
#header .fontsize a:hover {
    color: #d9fff0 !important;
}

/* === Изображения приложения === */
img.app-screenshot {
    display: block;
    margin: 20px auto;
    border-radius: 12px;
    box-shadow: 0 0 12px rgba(0,0,0,0.2);
    background: #ffffff;
    padding: 6px;
}

/* === Боковое меню === */
#left {
    background-color: #f1f6f3;
    border-right: 1px solid #d0ded7;
}

/* === Кнопки === */
.button, button, input[type="submit"] {
    background-color: #2e805f;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
}

.button:hover, button:hover, input[type="submit"]:hover {
    background-color: #3a9d75;
}

/* ============================================= */
/* === ДЕСКТОПНАЯ ВЕРСИЯ (от 801px) =========== */
/* ============================================= */
@media screen and (min-width: 801px) {

    #nav {
        position: relative;
        float: left;
        width: 20%;
        height: auto;
        transform: none;
        background: transparent;
        box-shadow: none;
        padding: 0 10px;
    }

    #content {
        float: left;
        width: 60%;
        margin-left: 0;
    }

    #right {
        float: left;
        width: 20%;
        display: block;
    }

    .menu-toggle,
    .menu-close {
        display: none !important;
    }

    #wrapper2 {
        float: left;
        width: auto;
        display: block;
        overflow: hidden;
    }

    .mobile-nav-overlay {
        display: none !important;
    }
}

/* ============================================= */
/* === МОБИЛЬНАЯ ВЕРСИЯ (до 800px) ============ */
/* ============================================= */
@media screen and (max-width: 800px) {

    /* Кнопка открытия */
    .menu-toggle {
        display: block !important;
        background-color: #4b7058;
        color: white;
        border: none;
        padding: 12px 16px;
        font-size: 20px;
        border-radius: 8px;
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(0,0,0,0.15);
        margin: 10px;
    }

    /* Выезжающее меню */
    #nav {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 260px !important;
        height: 100% !important;
        background-color: #4b7058 !important;
        padding: 20px !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease !important;
        z-index: 9999 !important;
        float: none !important;
        margin: 0 !important;
        border-radius: 0 20px 20px 0 !important;
        box-shadow: 5px 0 20px rgba(0,0,0,0.25) !important;
    }

    /* Меню открыто */
    #nav.open {
        transform: translateX(0) !important;
    }

    /* Цвет ссылок на тёмном фоне */
    /*#nav ul.menu li a {
        color: #e0f0e8 !important;
        background: transparent !important;
        border-left-color: transparent !important;
    }*/

    #nav ul.menu li a:hover {
        background-color: rgba(255,255,255,0.15) !important;
        color: #ffffff !important;
        border-left-color: #ffffff !important;
    }

    /* Оверлей */
    .mobile-nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 9998;
    }

    .mobile-nav-overlay.visible {
        display: block !important;
    }

    /* Кнопка закрытия (крестик) */
    .menu-close {
        display: block !important;
        background: none;
        border: none;
        color: #ffffff;
        font-size: 28px;
        cursor: pointer;
        margin-bottom: 20px;
        padding: 0;
        line-height: 1;
    }

    /* Контент на всю ширину */
    #content {
        width: 100%;
        float: none;
    }

    #right {
        display: none;
    }

    #wrapper2 {
        width: 95%;
        float: none;
        overflow: visible;
    }
}