/* ===== Page Help System Styles ===== */

/* Floating Help Button — правый верхний угол, под навигационной панелью */
#pageHelpBtn {
    position: fixed;
    top: 8px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #4a90a4;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.55);
    box-shadow: 0 1px 5px rgba(0,0,0,0.30);
    cursor: pointer;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    font-family: Georgia, serif;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    opacity: 0.92;
    user-select: none;
}
#pageHelpBtn:hover {
    background: #2c6f80;
    transform: scale(1.10);
    box-shadow: 0 3px 10px rgba(0,0,0,0.35);
    opacity: 1;
}
#pageHelpBtn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
/* Иконка "?" внутри кнопки — через псевдоэлемент, надёжно без FontAwesome */
#pageHelpBtn::after {
    content: "?";
    font-size: 17px;
    font-weight: 800;
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1;
    letter-spacing: 0;
}

/* Custom help overlay — не использует Bootstrap Modal API совсем */
#pageHelpPanel {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    /* display: none по умолчанию задаётся инлайново через JS */
}
#pageHelpDialog {
    background: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.35);
}
.help-dialog-header {
    background: #2c3e50;
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-shrink: 0;
}
.help-dialog-header > div { flex: 1; }
.help-btn-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    margin-top: -2px;
    flex-shrink: 0;
}
.help-btn-close:hover { color: #fff; }
.help-dialog-footer {
    padding: 8px 16px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Search bar */
#pageHelpSearch {
    border-radius: 20px;
    padding-left: 36px;
    font-size: 14px;
    border: 1px solid #ced4da;
    height: 36px;
    background: #fff;
    color: #333;
}
#pageHelpSearch::placeholder { color: #aaa; }
.help-search-wrapper {
    position: relative;
}
.help-search-wrapper .fa-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 13px;
    pointer-events: none;
}
#pageHelpSearchClear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 12px;
    display: none;
    padding: 0;
}
#pageHelpSearchClear:hover { color: #333; }

/* Layout: sidebar + content */
.help-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 300px;
}
.help-sidebar {
    width: 200px;
    min-width: 160px;
    background: #f4f6f8;
    border-right: 1px solid #e0e4e8;
    overflow-y: auto;
    padding: 8px 0;
    flex-shrink: 0;
}
.help-sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #444;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.help-sidebar-item:hover {
    background: #e9ecef;
    color: #2c3e50;
}
.help-sidebar-item.active {
    background: #e3f0f7;
    color: #2c7da0;
    border-left-color: #2c7da0;
    font-weight: 600;
}
.help-sidebar-item i {
    width: 16px;
    text-align: center;
    color: #6c757d;
    flex-shrink: 0;
}
.help-sidebar-item.active i {
    color: #2c7da0;
}

/* Content area */
.help-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    background: #fff;
}
.help-section {
    display: none;
}
.help-section.active {
    display: block;
}
.help-section h4 {
    color: #2c3e50;
    font-size: 17px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
}
.help-section h5 {
    color: #34495e;
    font-size: 14px;
    margin: 16px 0 8px;
    font-weight: 600;
}

/* Field tables */
.help-fields-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 16px;
}
.help-fields-table th {
    background: #f0f4f8;
    padding: 7px 10px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border: 1px solid #dee2e6;
}
.help-fields-table td {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    vertical-align: top;
    line-height: 1.4;
}
.help-fields-table tr:hover td { background: #f9fafb; }
.badge-manual {
    background: #d1ecf1;
    color: #0c5460;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}
.badge-auto {
    background: #d4edda;
    color: #155724;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}
.badge-system {
    background: #fff3cd;
    color: #856404;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* Hotkeys table */
.help-hotkeys-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 16px;
}
.help-hotkeys-table th {
    background: #2c3e50;
    color: #fff;
    padding: 7px 12px;
    text-align: left;
    border: 1px solid #34495e;
}
.help-hotkeys-table td {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
}
.help-hotkeys-table tr:nth-child(even) td { background: #f8f9fa; }
kbd {
    background: #eee;
    border: 1px solid #bbb;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 11px;
    font-family: monospace;
    color: #333;
    box-shadow: 1px 1px 0 #999;
    white-space: nowrap;
}

/* Step cards */
.help-step {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: flex-start;
}
.help-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #2c7da0;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}
.help-step-body strong { font-size: 13px; color: #2c3e50; }
.help-step-body p { font-size: 12px; color: #666; margin: 2px 0 0; }

/* Alert/tip boxes */
.help-tip {
    background: #fffbea;
    border-left: 4px solid #f0c040;
    padding: 8px 12px;
    border-radius: 0 6px 6px 0;
    font-size: 12.5px;
    color: #5a4a00;
    margin: 10px 0;
}
.help-info {
    background: #e8f4fd;
    border-left: 4px solid #2c7da0;
    padding: 8px 12px;
    border-radius: 0 6px 6px 0;
    font-size: 12.5px;
    color: #0d3d5a;
    margin: 10px 0;
}

/* Search highlight */
.help-highlight {
    background: #fff176;
    border-radius: 2px;
    padding: 0 1px;
}
.search-no-results {
    padding: 30px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

/* Scrollbar customization */
.help-sidebar::-webkit-scrollbar,
.help-content::-webkit-scrollbar { width: 5px; }
.help-sidebar::-webkit-scrollbar-thumb,
.help-content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
