/* ========================================================
 * template.css (v3.2.0) – исправленная версия
 * ======================================================== */

/* ----------------------------------------------
 * 1. Шрифты и внешние ресурсы
 * ---------------------------------------------- */
@font-face {
    font-family: "Philosopher";
    src: url("/media/fonts/Philosopher.ttf") format("truetype");
    font-style: normal;
    font-weight: normal;
}
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* ----------------------------------------------
 * 2. CSS-переменные
 * ---------------------------------------------- */
:root {
    --primary: #239cec;
    --primary-dark: #1a7bc9;
    --primary-light: #4cc9f0;
    --secondary: #1a3a5f;
    --secondary-dark: #0a1a2d;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --gray-dark: #495057;
    --font-family-base: 'Philosopher', sans-serif;
    --font-size-base: 13px;
    --line-height-base: 1.4;
    --font-weight-normal: 400;
    --font-weight-bold: 700;
    --spacer: 1rem;
    --border-radius: 6px;
    --border-radius-lg: 12px;
    --box-shadow: 0 4px 12px rgba(35,156,236,0.1);
    --border-color: #e2e8f0;
    --border-width: 1px;
    --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}
/* ----------------------------------------------
 * 2. Сброс и базовые стили
 * ---------------------------------------------- */
* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--dark);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
}
h1,h2,h3,h4,h5,h6 { font-weight: var(--font-weight-bold); margin-bottom: calc(var(--spacer) * 1.5); color: var(--secondary); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ----------------------------------------------
 * 3. Контейнеры
 * ---------------------------------------------- */
.container { max-width: 1600px; margin: 0 auto; padding: 0 15px; width:100%; }
.wrapper { display: flex; flex-direction: column; min-height: 100vh; }

/* ----------------------------------------------
 * 4. Тулбар
 * ---------------------------------------------- */
.toolbar {
    background: linear-gradient(360deg, #132d4b, #082442);
    color: white;
    border-bottom: var(--border-width) solid rgba(255,255,255,0.1);
    min-height: 30px;
    position: relative;
    z-index: 1002;
}
.toolbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 30px;
    padding: 0 15px;
}
.toolbar-left-group, .toolbar-center-group, .toolbar-right-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}


/* ----------------------------------------------
 * 6. Логотип
 * ---------------------------------------------- */
.logo-row { padding: 20px 0; background: white; border-bottom: var(--border-width) solid var(--border-color); }
.logo, .position-header-logo .moduletable {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 65px;
}
.logo-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    width: 40px; height: 40px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 20px;
}
.logo-text {
    font-size: 22px; font-weight: var(--font-weight-bold);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ----------------------------------------------
 * 7. Шапка (header)
 * ---------------------------------------------- */
#main-header {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}
#main-header.header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--primary);
    animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}
.header-container-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 65px;
    padding: 0 15px;
}
.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.main-menu-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}
.position-header-user-menu { display: none; }
#main-header.header-fixed .position-header-user-menu { display: flex; align-items: center; }
#main-header.header-fixed .logo-icon { background: white; color: var(--primary); }
#main-header.header-fixed .logo-text { color: white; -webkit-text-fill-color: white; background: none; }
#main-header.header-fixed .session-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 12px;
    margin-left: auto;
    margin-right: 20px;
    padding: 4px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
}


/* ----------------------------------------------
 * 7. Основной контент
 * ---------------------------------------------- */
.main-container { flex: 1 0 auto; }
.content-top-grid,
.content-bottom-grid,
.footer-menu-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin: 20px 0;
}
.content-above-row,
.content-below-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
}
.main-grid { display: grid; gap: 30px; margin: 30px 0; }
.main-grid.both-sidebars { grid-template-columns: 1fr 3fr 1fr; }
.main-grid.left-sidebar-only { grid-template-columns: 1fr 4fr; }
.main-grid.right-sidebar-only { grid-template-columns: 4fr 1fr; }
.main-grid.no-sidebars { grid-template-columns: 1fr; }
@media (max-width: 992px) { .main-grid { grid-template-columns: 1fr !important; } }
.content-area {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--box-shadow);
    margin: 20px 0;
}

/* ----------------------------------------------
 * 8. Футер
 * ---------------------------------------------- */
.footer-menu {
    background: linear-gradient(135deg, #1a3a5f 0%, #0a1a2d 100%);
    color: white;
    padding: 50px 0 30px;
}
.footer-menu-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 0px;
}
.footer-copyright, .footer-info { display: flex; align-items: center; gap: 15px; }

/* ----------------------------------------------
 * 9. Кнопки, формы
 * ---------------------------------------------- */
.btn {
    padding: 10px 16px; border: none; border-radius: 10px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 8px;
    transition: var(--transition); font-size: 0.95rem; cursor: pointer;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* ----------------------------------------------
 * 10. Адаптивность
 * ---------------------------------------------- */
@media (max-width: 1200px) {
    .content-top-grid, .content-bottom-grid, .footer-menu-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 992px) {
    .content-above-row, .content-below-row { grid-template-columns: 1fr; }
    .content-top-grid, .content-bottom-grid, .footer-menu-grid { grid-template-columns: repeat(3, 1fr); }
    .toolbar-content { flex-direction: column; padding: 5px 0; gap: 5px; }
}
@media (max-width: 768px) {
    .content-top-grid, .content-bottom-grid, .footer-menu-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-content { flex-direction: column; text-align: center; }
    .header-container-inner { flex-wrap: wrap; }
    .header-left, .header-right { width: 100%; justify-content: center; }
}
@media (max-width: 576px) {
    .content-top-grid, .content-bottom-grid, .footer-menu-grid { grid-template-columns: 1fr; }
}

/* ===== ИСПРАВЛЕНИЯ ДЛЯ mod_menu В ФИКСИРОВАННОЙ ШАПКЕ ===== */
#main-header.header-fixed .main-menu-wrapper {
    display: flex !important;
}
#main-header.header-fixed .position-header-main-menu {
    display: block !important;
}
#main-header.header-fixed .mod-menu .menu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}
#main-header.header-fixed .mod-menu .menu-item {
    position: relative;
}
#main-header.header-fixed .mod-menu .menu-link {
    color: white;
    padding: 8px 15px;
    display: block;
    text-decoration: none;
}
#main-header.header-fixed .mod-menu .menu-link:hover {
    background: rgba(255,255,255,0.1);
}
#main-header.header-fixed .mod-menu .menu-item.active > .menu-link {
    background: rgba(255,255,255,0.2);
}
/* Цветные иконки в футере */
.footer-content .copyright i {
    color: #f1c40f; /* жёлтый */
    margin-right: 5px;
}
.footer-content .footer-version i {
    color: #2ecc71; /* зелёный */
    margin-right: 5px;
}
.footer-content .footer-rights i {
    color: #3498db; /* синий */
    margin-right: 5px;
}
