﻿/* wwwroot/css/guide-help.css */

/* Base help icon styles */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: transparent;
    color: var(--bs-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

    .help-icon:hover {
        background-color: var(--bs-primary);
        color: white;
        transform: scale(1.1);
    }

/* Positioning for different contexts */

/* Card headers - float right */
.card-header[data-help-page] {
    position: relative;
}

.card-header .help-icon {
    float: right;
    margin-left: 10px;
    margin-top: 2px;
}

/* Headings - inline with margin */
h1 .help-icon,
h2 .help-icon,
h3 .help-icon,
h4 .help-icon,
h5 .help-icon,
h6 .help-icon {
    margin-left: 8px;
    vertical-align: middle;
    font-size: 0.75em;
}

/* Form groups - position with label */
.form-group[data-help-page] label,
.mb-3[data-help-page] label {
    display: inline-flex;
    align-items: center;
}

.form-group .help-icon,
.mb-3 .help-icon {
    margin-left: 6px;
}

/* Generic containers - top-right position */
[data-help-page] {
    position: relative;
}

    [data-help-page] > .help-icon:first-child {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 10;
    }

/* Special case for sections that shouldn't have absolute positioning */
.nav-item[data-help-page] .help-icon,
.list-group-item[data-help-page] .help-icon,
td[data-help-page] .help-icon {
    position: static;
    float: right;
}

/* Modal headers */
.modal-header[data-help-page] .help-icon {
    margin-left: auto;
    margin-right: 10px;
}

/* Tab panels */
.tab-pane[data-help-page] > .help-icon:first-child {
    float: right;
    margin: 10px;
}

/* Prevent icon from breaking layouts */
.help-icon {
    flex-shrink: 0;
}

/* Help Panel Styles */
.help-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background-color: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

    .help-panel.show {
        right: 0;
    }

.help-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

    .help-panel-header h5 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
    }

.help-panel-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.help-panel-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1049;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .help-overlay.show {
        opacity: 1;
        visibility: visible;
    }

/* Guide Content Styles */
.guide-content {
    line-height: 1.6;
}

    .guide-content h1,
    .guide-content h2,
    .guide-content h3,
    .guide-content h4,
    .guide-content h5,
    .guide-content h6 {
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .guide-content p {
        margin-bottom: 1rem;
    }

    .guide-content ul,
    .guide-content ol {
        margin-bottom: 1rem;
        padding-left: 2rem;
    }

    .guide-content code {
        background-color: #f8f9fa;
        padding: 2px 4px;
        border-radius: 3px;
        font-size: 0.875em;
    }

    .guide-content pre {
        background-color: #f8f9fa;
        padding: 1rem;
        border-radius: 0.25rem;
        overflow-x: auto;
    }

.guide-tags {
    color: #6c757d;
    font-size: 0.875rem;
}

.related-link {
    display: block;
    padding: 0.5rem 0;
    text-decoration: none;
    color: var(--bs-primary);
    transition: color 0.2s ease;
}

    .related-link:hover {
        color: var(--bs-primary-dark);
        text-decoration: underline;
    }

/* Responsive */
@media (max-width: 768px) {
    .help-panel {
        width: 100%;
        right: -100%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .help-panel {
        background-color: #212529;
        color: #f8f9fa;
    }

    .help-panel-header,
    .help-panel-footer {
        background-color: #343a40;
        border-color: #495057;
    }

    .guide-content code,
    .guide-content pre {
        background-color: #343a40;
    }

    .help-icon {
        color: var(--bs-gray-400);
    }

        .help-icon:hover {
            background-color: var(--bs-primary);
            color: white;
        }
}
