/* Context-Sensitive Help Widget styles. */

/* ---- Help Button Styles ---- */

.help-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.help-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #17a2b8;
    text-decoration: none;
    transition: color 0.2s;
}

.help-icon-link:hover {
    color: #117a8b;
}

.help-text-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #17a2b8;
    text-decoration: none;
    transition: color 0.2s;
}

.help-text-link:hover {
    color: #117a8b;
    text-decoration: underline;
}

/* ---- Floating Help Button ---- */

.btn-floating-help {
    position: fixed;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-floating-help:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    transform: scale(1.05);
}

.btn-floating-help:active {
    transform: scale(0.95);
}

/* Position classes for floating button */
.help-pos-tl {
    top: 24px;
    left: 24px;
}

.help-pos-tr {
    top: 24px;
    right: 24px;
}

.help-pos-bl {
    bottom: 24px;
    left: 24px;
}

.help-pos-br {
    bottom: 24px;
    right: 24px;
}

/* ---- Help Widget (Expandable) ---- */

.help-widget {
    position: relative;
    display: inline-block;
}

.help-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
}

.help-chevron {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

/* Help Panel (Dropdown) */
.help-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 400px;
    max-width: 90vw;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: helpPanelSlideDown 0.2s ease;
}

@keyframes helpPanelSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.help-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.help-panel-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
}

.help-panel-body {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
    color: #212529;
}

.help-panel-body p {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.help-panel-body .btn {
    margin-top: 8px;
}

.help-panel-body h6 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.help-panel-body ul {
    margin-bottom: 0;
}

.help-panel-body ul li {
    margin-bottom: 6px;
}

.help-panel-body ul li:last-child {
    margin-bottom: 0;
}

.help-panel-body a {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
}

.help-panel-body a:hover {
    text-decoration: underline;
}

/* ---- Inline Help ---- */

.help-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #e7f3ff;
    border-left: 4px solid #17a2b8;
    border-radius: 4px;
    font-size: 14px;
}

.help-inline i {
    font-size: 16px;
}

.help-inline a {
    color: #17a2b8;
    font-weight: 500;
    text-decoration: none;
}

.help-inline a:hover {
    text-decoration: underline;
}

/* ---- Responsive Adjustments ---- */

@media (max-width: 768px) {
    .help-panel {
        width: 320px;
        left: auto;
        right: 0;
    }
    
    .btn-floating-help {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .help-pos-tl,
    .help-pos-tr,
    .help-pos-bl,
    .help-pos-br {
        right: 16px;
        bottom: 16px;
        top: auto;
        left: auto;
    }
}

@media (max-width: 480px) {
    .help-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 80vh;
    }
    
    .help-panel-body {
        max-height: calc(80vh - 60px);
    }
}

/* ---- Dark Mode Support (Optional) ---- */

@media (prefers-color-scheme: dark) {
    .help-panel {
        background: #2b3035;
        border-color: #495057;
    }
    
    .help-panel-header {
        background: #343a40;
        border-color: #495057;
    }
    
    .help-panel-header h5 {
        color: #f8f9fa;
    }
    
    .help-panel-body {
        color: #f8f9fa;
    }
    
    .help-panel-body h6 {
        color: #dee2e6;
    }
    
    .help-inline {
        background: #1a3a4a;
        border-color: #17a2b8;
        color: #f8f9fa;
    }
}

/* ---- Accessibility Enhancements ---- */

.help-button:focus,
.help-toggle:focus,
.btn-floating-help:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.help-panel-header .btn-close:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
