/* Help Widget - Floating Tutorial Button */

.help-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Main floating button */
.help-widget-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    font-size: 24px;
}

.help-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.help-widget-button:active {
    transform: scale(0.95);
}

.help-widget-button.active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.help-widget-button .icon-driver {
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-widget-button .icon-driver svg {
    width: 32px;
    height: 34px;
}

.help-widget-button .icon-close {
    display: none;
    font-size: 20px;
}

.help-widget-button.active .icon-driver {
    display: none;
}

.help-widget-button.active .icon-close {
    display: block;
}

/* Popup menu */
.help-widget-popup {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
}

.help-widget-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Popup header */
.help-widget-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
}

.help-widget-header h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.help-widget-header p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

/* Tutorial list */
.help-widget-list {
    max-height: 350px;
    overflow-y: auto;
    padding: 10px 0;
}

.help-widget-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.help-widget-item:hover {
    background: #f8f9ff;
}

.help-widget-item:active {
    background: #eef1ff;
}

.help-widget-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
    flex-shrink: 0;
}

.help-widget-item-icon.welcome {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.help-widget-item-icon.invoice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.help-widget-item-icon.contact {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.help-widget-item-icon.opportunity {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.help-widget-item-icon.navigation {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.help-widget-item-content {
    flex: 1;
    min-width: 0;
}

.help-widget-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 2px 0;
}

.help-widget-item-desc {
    font-size: 12px;
    color: #888;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.help-widget-item-arrow {
    color: #ccc;
    font-size: 14px;
    margin-left: 10px;
}

.help-widget-item:hover .help-widget-item-arrow {
    color: #667eea;
    transform: translateX(3px);
}

/* Category - expandable */
.help-widget-category {
    border-bottom: 1px solid #f0f0f0;
}

.help-widget-category:last-child {
    border-bottom: none;
}

.help-widget-category-header {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.help-widget-category-header:hover {
    background: #f8f9ff;
}

.help-widget-category-header i:first-child {
    width: 24px;
    color: #667eea;
    margin-right: 10px;
}

.help-widget-category-header span {
    flex: 1;
}

.help-widget-category-header .chevron {
    color: #aaa;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.help-widget-category-header.expanded .chevron {
    transform: rotate(180deg);
}

.help-widget-category-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #fafbff;
}

.help-widget-category-items.expanded {
    max-height: 300px;
}

.help-widget-category-items .help-widget-item {
    padding: 10px 20px 10px 54px;
    font-size: 13px;
    color: #555;
}

.help-widget-category-items .help-widget-item i {
    width: 20px;
    margin-right: 10px;
    color: #888;
    font-size: 12px;
}

.help-widget-category-items .help-widget-item:hover {
    background: #eef1ff;
}

.help-widget-category-items .help-widget-item:hover i {
    color: #667eea;
}

/* Footer */
.help-widget-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.help-widget-footer-link {
    display: flex;
    align-items: center;
    color: #667eea;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

.help-widget-footer-link:hover {
    text-decoration: underline;
}

.help-widget-footer-link i {
    margin-right: 8px;
}

/* Badge for new tutorials */
.help-widget-badge {
    background: #ff4757;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 600;
}

/* Pulse animation for attention */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(102, 126, 234, 0.6), 0 0 0 10px rgba(102, 126, 234, 0.1);
    }
    100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
}

.help-widget-button.pulse {
    animation: pulse 2s infinite;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .help-widget-popup {
        width: calc(100vw - 40px);
        right: -10px;
    }

    .help-widget-container {
        bottom: 15px;
        right: 15px;
    }
}

/* Search Modal */
.help-widget-search-modal {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 1051;
}

.help-widget-search-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.help-widget-search-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.help-widget-search-title {
    font-size: 16px;
    font-weight: 600;
}

.help-widget-search-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
}

.help-widget-search-close:hover {
    opacity: 1;
}

.help-widget-search-body {
    padding: 15px;
}

.help-widget-search-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.help-widget-search-input:focus {
    outline: none;
    border-color: #667eea;
}

.help-widget-search-results {
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.help-widget-search-result {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.help-widget-search-result:hover {
    background: #f8f9ff;
}

.help-widget-search-result i:first-child {
    color: #667eea;
    margin-right: 12px;
    font-size: 14px;
}

.help-widget-search-result span {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.help-widget-search-result i:last-child {
    color: #ccc;
    font-size: 12px;
}

.help-widget-search-result:hover i:last-child {
    color: #667eea;
}

.help-widget-search-loading,
.help-widget-search-empty,
.help-widget-search-error {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 14px;
}

.help-widget-search-loading i,
.help-widget-search-empty i,
.help-widget-search-error i {
    margin-right: 8px;
}

.help-widget-search-error {
    color: #e74c3c;
}

/* Custom Driver.js overrides */
.driver-popover {
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
}

.driver-popover-title {
    font-size: 16px !important;
    font-weight: 600 !important;
}

.driver-popover-description {
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.driver-popover-progress-text {
    font-size: 12px !important;
}

.driver-popover-navigation-btns button {
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-weight: 500 !important;
}

.driver-popover-next-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}
