/* =====================================================
   HELP SYSTEM STYLES
   ===================================================== */

/* Help Panel Overlay */
.help-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1040;
}

.help-panel-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Help Panel */
.help-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    max-width: 90vw;
    height: 100vh;
    background-color: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1050;
    display: flex;
    flex-direction: column;
}

.help-panel.open {
    transform: translateX(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 h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #212529;
}

.help-panel-header h2 svg {
    flex-shrink: 0;
}

.panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    font-size: 1.25rem;
    transition: background-color 0.2s, color 0.2s;
}

.panel-close:hover {
    background-color: #e9ecef;
    color: #212529;
}

.help-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    scroll-behavior: smooth;
}

/* Anchor link offset for fixed header */
.help-panel-content [id] {
    scroll-margin-top: 16px;
}

/* TOC styling */
.help-panel-content > ul:first-of-type {
    background-color: #F4F5F7;
    border: 1px solid #DFE1E6;
    border-radius: 3px;
    padding: 16px 16px 16px 32px;
    margin-bottom: 24px;
}

.help-panel-content > ul:first-of-type::before {
    content: 'Contents';
    display: block;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6B778C;
    margin-bottom: 8px;
    margin-left: -16px;
}

.help-loading {
    display: flex;
    justify-content: center;
    padding: 3rem;
}

/* =====================================================
   ATLASSIAN DESIGN SYSTEM - ADF INSPIRED STYLING
   ===================================================== */

/* Typography - Atlassian style */
.help-panel-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-size: 14px;
    line-height: 1.714;
    color: #172B4D;
}

.help-panel-content h1 {
    font-size: 24px;
    font-weight: 500;
    line-height: 1.167;
    margin: 0 0 16px 0;
    color: #172B4D;
    letter-spacing: -0.01em;
}

.help-panel-content h2 {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.2;
    margin: 24px 0 12px 0;
    padding-bottom: 8px;
    color: #172B4D;
    border-bottom: 2px solid #DFE1E6;
    letter-spacing: -0.008em;
}

.help-panel-content h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    margin: 20px 0 8px 0;
    color: #172B4D;
}

.help-panel-content h4 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.429;
    margin: 16px 0 4px 0;
    color: #172B4D;
}

.help-panel-content p {
    margin: 0 0 12px 0;
    color: #172B4D;
}

.help-panel-content a {
    color: #0052CC;
    text-decoration: none;
}

.help-panel-content a:hover {
    color: #0065FF;
    text-decoration: underline;
}

/* Lists */
.help-panel-content ul,
.help-panel-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.help-panel-content ul {
    list-style-type: disc;
}

.help-panel-content ol {
    list-style-type: decimal;
}

.help-panel-content li {
    margin: 4px 0;
    padding-left: 4px;
    color: #172B4D;
}

.help-panel-content li::marker {
    color: #6B778C;
}

.help-panel-content ul ul,
.help-panel-content ol ol,
.help-panel-content ul ol,
.help-panel-content ol ul {
    margin: 4px 0;
}

/* Tables */
.help-panel-content table {
    width: 100%;
    margin: 16px 0;
    border-collapse: collapse;
    border: 1px solid #DFE1E6;
    border-radius: 3px;
}

.help-panel-content th,
.help-panel-content td {
    padding: 8px 12px;
    text-align: left;
    border: 1px solid #DFE1E6;
    vertical-align: top;
}

.help-panel-content th {
    background-color: #F4F5F7;
    font-weight: 600;
    color: #172B4D;
}

.help-panel-content tr:hover td {
    background-color: #FAFBFC;
}

/* Inline code */
.help-panel-content code {
    background-color: #F4F5F7;
    border-radius: 3px;
    padding: 2px 4px;
    font-family: 'SFMono-Medium', 'SF Mono', 'Segoe UI Mono', 'Roboto Mono', 'Ubuntu Mono', Menlo, Consolas, Courier, monospace;
    font-size: 12px;
    color: #172B4D;
}

/* Code blocks */
.help-panel-content pre {
    background-color: #F4F5F7;
    border-radius: 3px;
    padding: 12px;
    margin: 12px 0;
    overflow-x: auto;
}

.help-panel-content pre code {
    background: none;
    padding: 0;
    font-size: 12px;
    line-height: 1.5;
}

/* Horizontal rule */
.help-panel-content hr {
    margin: 24px 0;
    border: none;
    border-top: 1px solid #DFE1E6;
}

.help-panel-content strong {
    font-weight: 600;
    color: #172B4D;
}

.help-panel-content em {
    font-style: italic;
}

/* =====================================================
   ADF PANELS - Callouts (Note, Tip, Warning, Important)
   ===================================================== */

.callout {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 3px;
    margin: 16px 0;
    border-left: none;
}

.callout-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.callout-content {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    line-height: 1.714;
}

.callout-content strong {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

/* Info/Note - Blue */
.callout-note {
    background-color: #DEEBFF;
}

.callout-note .callout-icon {
    color: #0052CC;
}

.callout-note .callout-content strong {
    color: #0052CC;
}

/* Success/Tip - Green */
.callout-tip {
    background-color: #E3FCEF;
}

.callout-tip .callout-icon {
    color: #006644;
}

.callout-tip .callout-content strong {
    color: #006644;
}

/* Warning - Yellow */
.callout-warning {
    background-color: #FFFAE6;
}

.callout-warning .callout-icon {
    color: #FF8B00;
}

.callout-warning .callout-content strong {
    color: #172B4D;
}

/* Error/Important - Red */
.callout-important {
    background-color: #FFEBE6;
}

.callout-important .callout-icon {
    color: #DE350B;
}

.callout-important .callout-content strong {
    color: #DE350B;
}

/* =====================================================
   RESIZE HANDLE
   ===================================================== */

.help-panel-resize {
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
    background: linear-gradient(to right, #dee2e6 0%, transparent 100%);
    transition: background 0.2s;
    z-index: 10;
}

.help-panel-resize:hover {
    background: linear-gradient(to right, #0d6efd 0%, rgba(13, 110, 253, 0.1) 100%);
}

.help-panel-resize::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 1px;
    transform: translateY(-50%);
    width: 3px;
    height: 40px;
    background: #adb5bd;
    border-radius: 2px;
    transition: background 0.2s;
}

.help-panel-resize:hover::after {
    background: #0d6efd;
}
