/* Enhanced Help System Styles - Better Visibility Version */
.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Reduced opacity for better visibility */
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.help-overlay.active {
    opacity: 1;
    visibility: visible;
}

.help-backdrop-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    opacity: 0.3;
    /* Reduced opacity */
    z-index: 10001;
    pointer-events: none;
}

.help-backdrop-content i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.help-backdrop-content p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.help-backdrop-content small {
    font-size: 0.85rem;
    opacity: 0.5;
}

.help-spotlight {
    position: absolute;
    background: transparent;
    border: 3px solid var(--bs-primary);
    /* Removed gradient, solid color */
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4),
        /* Reduced overlay opacity */
        0 0 20px rgba(var(--bs-primary-rgb), 0.6);
    /* Simplified glow */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 10002;
}

.help-panel {
    position: fixed;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 380px;
    max-width: 90vw;
    max-height: 80vh;
    z-index: 10003;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.help-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.help-panel-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--bs-border-color);
    background: var(--bs-primary);
    /* Solid color instead of gradient */
    color: white;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.help-header-content h5 {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 1.1rem;
}

.help-tour-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.help-tour-name {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 500;
}

.help-estimated-time {
    font-size: 0.75rem;
    opacity: 0.8;
}

.help-panel-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.help-panel-header .btn-close:hover {
    opacity: 1;
}

.help-panel-body {
    padding: 24px;
    max-height: 50vh;
    overflow-y: auto;
}

.help-content {
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.step-content {
    margin-bottom: 16px;
}

.help-action-hint {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    background: rgba(var(--bs-info-rgb), 0.1);
    border-left: 4px solid var(--bs-info);
    border-radius: 8px;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--bs-info);
    font-weight: 500;
}

.help-action-hint i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.help-panel-progress {
    padding-top: 20px;
    border-top: 1px solid var(--bs-border-color);
}

.help-panel-progress .progress {
    height: 6px;
    margin-bottom: 14px;
    background: rgba(var(--bs-primary-rgb), 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.help-panel-progress .progress-bar {
    background: var(--bs-primary);
    /* Solid color instead of gradient */
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
}

.help-step-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.help-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 20px;
    background: rgba(var(--bs-light-rgb), 0.5);
    border-top: 1px solid var(--bs-border-color);
}

.help-footer-left,
.help-footer-right {
    display: flex;
    gap: 8px;
}

.help-footer-left .btn,
.help-footer-right .btn {
    font-size: 0.85rem;
    padding: 7px 14px;
    border-radius: 6px;
    font-weight: 500;
}

.help-target-focus {
    position: relative;
    z-index: 10002;
}

.help-target-focus::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: var(--bs-primary);
    /* Solid color instead of gradient */
    border-radius: 10px;
    z-index: -1;
    animation: helpGlow 2s ease-in-out infinite alternate;
    opacity: 0.3;
}

@keyframes helpGlow {
    from {
        opacity: 0.2;
        transform: scale(1);
    }

    to {
        opacity: 0.4;
        transform: scale(1.01);
    }
}

.help-highlight-click {
    animation: helpPulseClick 2s infinite;
    position: relative;
    z-index: 10002;
}

.help-highlight-hover {
    animation: helpPulseHover 2s infinite;
    position: relative;
    z-index: 10002;
}

@keyframes helpPulseClick {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(var(--bs-danger-rgb), 0.7);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(var(--bs-danger-rgb), 0);
        transform: scale(1.02);
    }
}

@keyframes helpPulseHover {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(var(--bs-warning-rgb), 0.7);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(var(--bs-warning-rgb), 0);
    }
}

.help-click-indicator {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(var(--bs-danger-rgb), 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    position: relative;
}

.help-click-ripple {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bs-danger);
    animation: helpClickRipple 1.2s ease-out infinite;
}

.help-click-ripple:nth-child(2) {
    animation-delay: 0.4s;
}

.help-click-ripple:nth-child(3) {
    animation-delay: 0.8s;
}

@keyframes helpClickRipple {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(3.5);
        opacity: 0;
    }
}

.help-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bs-primary);
    /* Solid color instead of gradient */
    color: white;
    border: none;
    font-size: 24px;
    box-shadow: 0 8px 25px rgba(var(--bs-primary-rgb), 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 35px rgba(var(--bs-primary-rgb), 0.4);
    color: white;
}

.help-toggle:active {
    transform: translateY(-1px) scale(0.98);
}

.help-suggestion {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1049;
    max-width: 350px;
    animation: helpSlideIn 0.4s ease-out;
}

@keyframes helpSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.help-suggestion-content {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    gap: 10px;
}

.help-suggestion-content i {
    color: var(--bs-warning);
    font-size: 1.3rem;
    flex-shrink: 0;
}

.suggestion-message {
    flex: 1;
    font-weight: 500;
}

.help-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-content i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--bs-primary);
}

.loader-content p {
    font-size: 1rem;
    margin: 0;
}

/* Enhanced highlighting for form elements */
.help-target-focus input,
.help-target-focus select,
.help-target-focus textarea {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

/* Better highlighting for collapsible sections */
.help-target-focus.collapse.show {
    border: 2px solid var(--bs-primary);
    border-radius: 8px;
    padding: 12px;
    background: rgba(var(--bs-primary-rgb), 0.05);
}

/* Enhanced button highlighting */
.help-highlight-click.btn {
    transform: scale(1.03);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.3);
}

/* Better visibility for search inputs */
.help-target-focus input[type="search"] {
    background-color: rgba(var(--bs-primary-rgb), 0.08);
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Help Menu Styles */
.help-category {
    border-bottom: 1px solid var(--bs-border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.help-category:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.help-category-title {
    color: var(--bs-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.help-tour-item {
    padding: 16px;
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bs-body-bg);
}

.help-tour-item:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.1);
    transform: translateY(-2px);
}

.help-tour-item.completed {
    background: rgba(var(--bs-success-rgb), 0.05);
    border-color: var(--bs-success);
}

.help-tour-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
}

.help-tour-header h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
}

.help-tour-header .badge {
    font-size: 0.75rem;
    padding: 3px 7px;
    margin-left: 10px;
}

.help-tour-item p {
    flex-grow: 1;
    margin-bottom: 14px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--bs-secondary-color);
}

.tour-meta {
    margin-bottom: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(var(--bs-border-color-rgb), 0.5);
}

.tour-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tour-actions .btn {
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 6px;
}

/* Statistics Display */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: rgba(var(--bs-primary-rgb), 0.05);
    border-radius: 8px;
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--bs-primary);
    margin-bottom: 3px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
    font-weight: 500;
}

/* Toast Notifications */
.help-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10050;
    min-width: 280px;
}

.help-completion-toast {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-success);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 25px rgba(var(--bs-success-rgb), 0.2);
    z-index: 1049;
    max-width: 340px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s ease;
}

.help-completion-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.toast-content i {
    font-size: 1.3rem;
    margin-top: 2px;
}

.toast-text strong {
    display: block;
    margin-bottom: 3px;
    font-size: 0.95rem;
}

.toast-text p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

/* Search Tips Modal */
.search-tips .tip-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.search-tips .tip-item:last-child {
    border-bottom: none;
}

.search-tips h6 {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.search-tips p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
}

/* Disable body scroll when help is active */
body.help-active {
    overflow: hidden;
}

/* Dark mode support */
[data-bs-theme="dark"] .help-panel {
    background: var(--bs-dark);
    border-color: var(--bs-gray-700);
}

[data-bs-theme="dark"] .help-panel-header {
    border-color: var(--bs-gray-700);
}

[data-bs-theme="dark"] .help-panel-footer {
    background: rgba(var(--bs-gray-800-rgb), 0.6);
    border-color: var(--bs-gray-700);
}

[data-bs-theme="dark"] .help-tour-item {
    border-color: var(--bs-gray-700);
    background: var(--bs-gray-800);
}

[data-bs-theme="dark"] .help-tour-item:hover {
    border-color: var(--bs-primary);
}

[data-bs-theme="dark"] .help-suggestion,
[data-bs-theme="dark"] .help-completion-toast {
    background: var(--bs-gray-800);
    border-color: var(--bs-gray-700);
}

[data-bs-theme="dark"] .stat-item {
    background: rgba(var(--bs-primary-rgb), 0.1);
}

/* Responsive design */
@media (max-width: 768px) {
    .help-panel {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 40px);
        border-radius: 12px;
    }

    .help-toggle {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
        font-size: 20px;
    }

    .help-suggestion,
    .help-completion-toast {
        bottom: 80px;
        right: 20px;
        max-width: calc(100vw - 40px);
    }

    .help-panel-footer {
        flex-direction: column;
        gap: 12px;
        padding: 14px 20px 16px;
    }

    .help-footer-left,
    .help-footer-right {
        width: 100%;
        justify-content: center;
    }

    .help-panel-header {
        padding: 16px 20px 14px;
    }

    .help-panel-body {
        padding: 20px 18px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .help-spotlight {
        border-width: 4px;
        border-color: #000;
    }

    .help-panel {
        border-width: 2px;
        border-color: #000;
    }

    .help-target-focus::before {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .help-panel,
    .help-overlay,
    .help-spotlight,
    .help-tour-item,
    .help-toggle {
        transition: none;
    }

    .help-highlight-click,
    .help-highlight-hover,
    .help-target-focus::before,
    .help-click-ripple {
        animation: none;
    }

    .help-suggestion {
        animation: none;
    }
}

/* Print styles */
@media print {

    .help-overlay,
    .help-panel,
    .help-toggle,
    .help-suggestion,
    .help-completion-toast {
        display: none !important;
    }
}