/* styles.css — рефакторинг, объединённые и упорядоченные правила */

/* ==================
   Базовые настройки
   ================== */
html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #111;
    color: #fff;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

h2 { position: relative; }
p { color: #d7d7d7; }

/* ==================
   Навигация
   ================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: #000000;
    z-index: 1000;
    text-align: center;
    padding: 10px 0;
}

.navbar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.navbar li { margin: 0 15px; }

.navbar a {
    color: #fff;
    text-decoration: none;
    font-size: 1em;
    transition: color 0.3s;
}

.navbar a:hover { color: #f39c12; }

/* ==================
   Блок контактов и название компании
   ================== */
.contacts {
    position: absolute !important;
    top: 42px;
    right: 0;
    width: 200px;
    color: #fff;
    font-size: 1em;
    z-index: 999;
    background-color: rgb(31 31 31 / 50%) !important;
    padding: 10px 20px !important;
    border-radius: 5px;
}

.contacts p { margin: 10px; font-size: 14px; }

.company-name {
    position: absolute;
    top: 540px;
    left: 10px;
    z-index: 1;
}

.company-name h1 {
    font-size: 2em;
    margin: 10px;
    color: #bbbbbb52;
}

/* ==================
   Хедер / верхний баннер
   ================== */
/* используем последовательность фонов — сначала внешний, затем локальный (fallback) */
.header {
    background-image: url('images/wave.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    text-align: center;
    padding: 150px 20px; /* максимально сохранено */
    margin-top: 30px;
    position: relative;
}

.header h1 { font-size: 3em; margin-bottom: 0.5em; }
.header p {
    background: #21212161;
    margin: 0 30%;
    padding-bottom: 20px;
    border-radius: 16px;
    font-size: 1.5em;
    margin-bottom: 1em;
}

/* общие правила для кнопок в хедере */
.header button {
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    border-radius: 5px;
    margin: 0 10px;
}

/* оригинальный оранжевый (использовался в начале файла) */
.header button.btn-primary { background-color: #f39c12; }

/* специализированные кнопки с id — сохранены специфичные цвета */
.header button { position: relative; top: 100px; }
.header button#downloadButton { background-color: #1344ab; }
.header button#requestDemoButton { background-color: #ad00de; }

/* ==================
   Оверлей
   ================== */
.overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #000000;
    opacity: 0.7;
    top: 0;
    left: 0;
}

/* ==================
   Секции и карточки функций
   ================== */
.section { padding: 50px 20px; text-align: center; }

#services {
    position: relative;
    background-image: url("images/pyramids.png");
    background-size: cover;
}

#features {
    position: relative;
    background-image: url("images/pyramids.png");
    background-size: cover;
}

.features-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px 40px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.feature-block {
    background-color: #222;
    padding: 40px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.feature-content { padding-left: 10px; }

.feature-block:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    border-radius: 10px 0 0 10px;
}

.feature-block.blue::before { background-color: #034ef2; }
.feature-block.green::before { background-color: #008e8e; }
.feature-block.yellow::before { background-color: #f1c40f; }
.feature-block.purple::before { background-color: #ff02a7; }

.feature-block h3 { margin-top: 0; font-weight: bold; }
.feature-block p { margin: 10px 0 0; }

/* ==================
   Документация (меню + контент)
   ================== */
.doc-container { display: flex; justify-content: center; padding: 20px 0; text-align: left; position: relative; }

.doc-menu {
    width: 25%;
    max-width: 500px;
    margin-right: 60px;
    transition: box-shadow 0.18s ease, transform 0.12s ease;
    will-change: top, left;
    background: #101010
}

.doc-menu-placeholder { display: block; visibility: hidden; width: 100%; height: 1px; }

.doc-content { width: 70%; max-width: 800px; transition: padding-top 0.12s ease; line-height: 24px; }
.doc-content p { margin-bottom: 42px; }

.doc-menu ul { list-style: none; padding: 0; }

.doc-menu li {
    cursor: pointer;
    margin-bottom: 14px;
    background-color: #3333334d;
    padding: 16px 26px;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.12s ease, box-shadow 0.18s ease;
}

.doc-menu li.active {
    background-color: #ff02a7;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
    transform: translateY(-2px);
    transition: background-color 0.3s, transform 0.12s ease, box-shadow 0.18s ease;
}
.doc-menu li.active .feature-block {
    background-color: #ff02a7;
    transition: background-color 0.3s, transform 0.12s ease, box-shadow 0.18s ease;
}

.doc-menu li.active .feature-block .feature-content span {
    color: #fff;
    text-decoration: underline;
}

/*.doc-menu li:hover { background-color: #444; }*/


/*.doc-menu-item.no-bg {*/
/*    background-color: transparent;*/
/*    margin-bottom: 0 !important;*/
/*}*/


/* Стили для компактного отображения feature-block внутри бокового меню */
.doc-menu .feature-block {
    background: transparent; /* не перекрываем фон меню */
    padding: 10px 12px;        /* компактные отступы */
    border-radius: 6px;
    min-height: 44px;
    display: flex;
    align-items: center;
    position: relative;       /* чтобы ::before работал корректно */
    overflow: visible;
}

.doc-menu .feature-block .feature-content { padding-left: 14px; }
.doc-menu .feature-block .feature-content span { color: #fff; font-weight: 600; display: block; }

/* чуть тоньше и отступы у цветной полосы в боковом меню */
.doc-menu .feature-block:before { left: 0; top: 6px; bottom: 6px; width: 6px; border-radius: 4px 0 0 4px; }

/* ==================
   Отзывы / секция с фоном
   ================== */
#reviews { background-image: url('images/wave2.jpg'); background-size: cover; }

/* ==================
   Футер
   ================== */
footer { background-color: #222; text-align: center; padding: 20px 0; }

/* ==================
   Вспомогательные классы (таблицы, изображения, состояние)
   ================== */
.overflow-container { overflow: auto; max-width: 100%; }
.table-default { width: 100%; border-collapse: collapse; font-size: 14px; }
.th-left { text-align: left; padding: 8px; border-bottom: 1px solid #444; }
.th-right { text-align: right; padding: 8px; border-bottom: 1px solid #444; }
.td { padding: 8px; border-bottom: 1px solid #333; }
.td-right { text-align: right; padding: 8px; border-bottom: 1px solid #333; }
.tr-highlight { background: rgb(0,142,142); }
.contact-link { color: #fff; text-decoration: underline; }
.responsive-img { max-width: 100%; height: auto; margin-top: 20px; margin-bottom: 20px; }
.note-text { margin-top: 12px; font-size: 13px; color: #cfcfcf; }
.active-doc { display: block !important; }
.hidden { display: none; }

/* по умолчанию скрываем все элементы контента документации; показываем только .active-doc */
.doc-item { display: none; }

/* декоративные элементы */
.sky-background { position: absolute; left: 0; top: 0; z-index: -1; }

/* дополнительные мелкие правки для совместимости */
@media (max-width: 800px) {
    .features-container { grid-template-columns: 1fr; }
    .doc-container { flex-direction: column; }
    .doc-menu { width: 100%; max-width: none; margin-right: 0  !important; }
    .doc-content { width: 100%; }
    .company-name { display: none !important; }

    /* Responsive tables: превращаем таблицу в набор карточек */
    .overflow-container { overflow: visible !important; }

    .table-default.responsive {
        border: 0 !important;
    }

    .table-default.responsive thead {
        display: none !important; /* скрываем заголовок */
    }

    .table-default.responsive tbody,
    .table-default.responsive tr,
    .table-default.responsive td {
        display: block !important;
        width: 100% !important;
    }

    .table-default.responsive tr {
        margin: 0 0 12px 0 !important;
        padding: 10px 12px !important;
        background: rgba(255,255,255,0.02) !important;
        border-radius: 6px !important;
        box-sizing: border-box !important;
        border: 1px solid rgba(255,255,255,0.03) !important;
    }

    /* Сохранить фоновый цвет для строк с классом tr-highlight */
    .table-default.responsive tr.tr-highlight {
        background: rgb(0,142,142) !important; /* оригинальный цвет подсветки */
        border-color: rgba(0,0,0,0.12) !important;
    }

    /* Убедиться, что ячейки внутри подсвеченной строки прозрачны, чтобы фон tr был виден */
    .table-default.responsive tr.tr-highlight td {
        background: transparent !important;
        border: none !important;
    }

    /* Контрастный цвет текста и меток внутри подсвеченной строки */
    .table-default.responsive tr.tr-highlight td::before {
        color: #ffffff !important;
    }
    .table-default.responsive tr.tr-highlight td > .cell-value {
        color: #ffffff !important;
    }

    /* В мобильном блочном виде все ячейки должны выравниваться по левому краю */
    .table-default.responsive td,
    .table-default.responsive td.td-right,
    .table-default.responsive td.td,
    .table-default.responsive td.td-left {
        text-align: left !important;
    }

    .table-default.responsive td {
        padding: 6px 0 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 12px !important;
        border: none !important;
    }

    .table-default.responsive td::before {
        content: attr(data-label) !important;
        flex: 0 0 40% !important;
        max-width: 40% !important;
        font-weight: 700 !important;
        color: #cfcfcf !important;
        white-space: normal !important;
        word-break: break-word !important;
        display: block !important;
        text-align: left !important;
    }

    .table-default.responsive td > .cell-value {
        flex: 1 1 60% !important;
        color: #d7d7d7 !important;
        word-break: break-word !important;
        text-align: left !important;
    }

    /* В случае, если в строке одна ячейка — не показываем метку */
    .table-default.responsive tr > td:only-child::before { display: none !important; }
}
