/**
 * Help System Styles
 * Floating help button, help drawers, tooltips, first-time tips
 */

/* Floating Help Button */
.btn-floating-help {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-floating-help:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.btn-floating-help:active {
    transform: scale(0.95);
}

/* Help Toggle Icon in Page Titles */
.help-toggle-icon {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.help-toggle-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.help-toggle-icon i {
    font-size: 0.8em;
}

/* First-Time Tip Banner */
.alert[id^="firstTimeTip-"] {
    border-left: 4px solid var(--bs-primary);
    background: linear-gradient(135deg, rgba(var(--bs-primary-rgb), 0.1) 0%, rgba(var(--bs-primary-rgb), 0.05) 100%);
}

.alert[id^="firstTimeTip-"] .fas.fa-lightbulb {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Help Panel Card */
.card[id^="helpPanel-"] {
    border-width: 2px;
}

.card[id^="helpPanel-"] .card-header {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-info) 100%);
}

/* Help Drawer (Offcanvas) */
#helpDrawer {
    width: 400px;
    max-width: 100%;
}

#helpDrawer .offcanvas-header {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-info) 100%);
}

#helpDrawer .offcanvas-body {
    padding: 1.5rem;
}

#helpDrawerContent ul {
    padding-left: 1.25rem;
}

#helpDrawerContent ul li {
    margin-bottom: 0.5rem;
}

/* Help Tooltips Enhancement */
[data-help] {
    position: relative;
}

[data-help]:not(.no-help-cursor) {
    cursor: help;
}

/* Add subtle underline to help elements */
[data-help]:not(.btn):not(.card):not(.badge) {
    border-bottom: 1px dotted rgba(var(--bs-primary-rgb), 0.5);
}

/* Help Modal */
#helpModal .modal-dialog {
    max-width: 600px;
}

#helpModal .modal-body ul {
    padding-left: 1.5rem;
}

#helpModal .modal-body ul li {
    margin-bottom: 0.5rem;
}

/* Help Center Search */
.help-center-search .input-group-text {
    border-right: 0;
}

.help-center-search .form-control {
    border-left: 0;
}

.help-center-search .form-control:focus {
    border-left: 0;
    box-shadow: none;
}

/* Help Article Cards */
.help-article-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.125);
    cursor: pointer;
}

.help-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.help-article-card .card-title {
    color: var(--bs-primary);
    font-size: 1.1rem;
}

/* Role Badges */
.role-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.75rem;
}

/* Help Category Icons */
.help-category-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(var(--bs-primary-rgb), 0.1);
    margin-bottom: 12px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .btn-floating-help {
        width: 48px;
        height: 48px;
        bottom: 16px;
        right: 16px;
    }

    #helpDrawer {
        width: 100%;
    }

    .help-toggle-icon {
        display: none;
    }
}

/* Dark mode support (if your app uses dark mode) */
@media (prefers-color-scheme: dark) {
    .btn-floating-help {
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
    }

    .btn-floating-help:hover {
        box-shadow: 0 6px 20px rgba(255, 255, 255, 0.25);
    }
}

/* Print styles - hide help elements when printing */
@media print {
    .btn-floating-help,
    #helpDrawer,
    .help-toggle-icon,
    [id^="firstTimeTip-"],
    [id^="helpPanel-"] {
        display: none !important;
    }
}

/* Accessibility enhancements */
.btn-floating-help:focus-visible {
    outline: 3px solid var(--bs-warning);
    outline-offset: 2px;
}

.help-toggle-icon:focus-visible {
    outline: 2px solid var(--bs-warning);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Loading state */
.help-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.help-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}
