/* Help Bubble Widget Styles */

/* ============================================
   HELP BUBBLE BUTTON
   ============================================ */
.help-bubble-widget {
    position: fixed;
    bottom: 84px;
    left: 20px;
    z-index: 2147483000;
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.help-bubble-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.75rem;
    background: linear-gradient(135deg, #0891B2 0%, #06B6D4 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9375rem;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    width: 48px;
    height: 48px;
    position: relative;
}

.help-bubble-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.4);
    background: linear-gradient(135deg, #0ea5e9 0%, #22d3ee 100%);
    padding: 0.75rem 1.25rem;
    width: auto;
    gap: 0.5rem;
}

.help-bubble-button:active {
    transform: translateY(0);
}

.help-bubble-button i {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.help-bubble-button-text {
    max-width: 0;
    opacity: 0;
    white-space: nowrap;
    transition: all 0.3s ease;
    overflow: hidden;
}

.help-bubble-button:hover .help-bubble-button-text {
    max-width: 100px;
    opacity: 1;
}

/* Unread indicator dot */
.help-bubble-unread {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #EF4444;
    border-radius: 50%;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ============================================
   HELP PANEL (Expanded State)
   ============================================ */
.help-bubble-panel {
    position: fixed;
    bottom: 84px;
    left: 20px;
    z-index: 2147483000;
    transform-origin: left bottom;
    visibility: hidden;
    height: min(704px, calc(100% - 104px));
    min-height: 80px;
    width: min(400px, calc(100vw - 40px));
    max-height: 704px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: rgba(9, 14, 21, 0.16) 0px 5px 40px 0px;
    opacity: 0;
    transition: width 200ms, height 200ms, max-height 200ms, transform 300ms cubic-bezier(0, 1.2, 1, 1), opacity 83ms ease-out;
    pointer-events: none;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.help-bubble-panel.open {
    visibility: visible;
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
}

.help-bubble-panel.closing {
    transform: scale(0.95);
    opacity: 0;
}

/* Panel Header */
.help-panel-header {
    background: linear-gradient(135deg, #0891B2 0%, #06B6D4 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.help-panel-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-panel-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.help-panel-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Panel Content Area */
.help-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Tab Content */
.help-tab-content {
    display: none;
    height: 100%;
    flex-direction: column;
}

.help-tab-content.active {
    display: flex;
}

/* Panel Footer (Tab Navigation) */
.help-panel-footer {
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    flex-shrink: 0;
}

.help-panel-tab {
    flex: 1;
    padding: 12px 8px;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    position: relative;
}

.help-panel-tab:hover {
    background: #f1f5f9;
    color: #0891B2;
}

.help-panel-tab.active {
    color: #0891B2;
    background: #fff;
}

.help-panel-tab.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #0891B2;
}

.help-panel-tab i {
    font-size: 16px;
}

.help-panel-tab-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 20px);
    width: 8px;
    height: 8px;
    background: #EF4444;
    border-radius: 50%;
}

/* ============================================
   FEEDBACK TAB CONTENT
   ============================================ */
.feedback-tab-inner {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.feedback-intro {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 16px;
}

.feedback-type-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.feedback-type-btn {
    flex: 1;
    padding: 12px 8px;
    border: 2px solid #e2e8f0;
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.feedback-type-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.feedback-type-btn.active {
    border-color: #0891B2;
    background: #f0fdff;
}

.feedback-type-btn.bug.active {
    border-color: #EF4444;
    background: #FEF2F2;
}

.feedback-type-btn.feature.active {
    border-color: #0891B2;
    background: #f0fdff;
}

.feedback-type-btn.question.active {
    border-color: #8B5CF6;
    background: #F5F3FF;
}

.feedback-type-btn i {
    font-size: 20px;
    display: block;
    margin-bottom: 4px;
}

.feedback-type-btn.bug i { color: #EF4444; }
.feedback-type-btn.feature i { color: #0891B2; }
.feedback-type-btn.question i { color: #8B5CF6; }

.feedback-type-btn span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
}

.feedback-textarea {
    flex: 1;
    width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    resize: none;
    transition: border-color 0.2s;
    min-height: 120px;
}

.feedback-textarea:focus {
    outline: none;
    border-color: #0891B2;
}

.feedback-submit-btn {
    margin-top: 12px;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #0891B2 0%, #06B6D4 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.feedback-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   GUIDES TAB CONTENT
   ============================================ */
.guides-tab-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.guides-search {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.guides-search-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2394a3b8' viewBox='0 0 20 20'%3E%3Cpath d='M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z'/%3E%3C/svg%3E") no-repeat 10px center;
    background-size: 18px;
    transition: all 0.2s;
}

.guides-search-input:focus {
    outline: none;
    border-color: #0891B2;
    background-color: #fff;
}

.guides-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.guides-category {
    margin-bottom: 8px;
}

.guides-category-header {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.guides-category-header i {
    font-size: 14px;
}

.guides-category-header .chevron {
    margin-left: auto;
    transition: transform 0.2s;
}

.guides-category.collapsed .chevron {
    transform: rotate(-90deg);
}

.guides-category.collapsed .guides-category-items {
    display: none;
}

.guide-item {
    display: flex;
    align-items: center;
    padding: 10px 16px 10px 32px;
    cursor: pointer;
    transition: background 0.15s;
}

.guide-item:hover {
    background: #f1f5f9;
}

.guide-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.guide-item-icon i {
    font-size: 14px;
    color: #64748b;
}

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

.guide-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guide-item-summary {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guide-item-arrow {
    color: #cbd5e1;
    margin-left: 8px;
}

/* Guide Detail View */
.guide-detail {
    display: none;
    height: 100%;
    flex-direction: column;
}

.guide-detail.active {
    display: flex;
}

.guide-detail-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.guide-back-btn {
    background: none;
    border: none;
    color: #0891B2;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
}

.guide-back-btn:hover {
    text-decoration: underline;
}

.guide-detail-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guide-detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.guide-detail-content h1 { font-size: 1.5rem; margin-bottom: 0.75rem; color: #1e293b; }
.guide-detail-content h2 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.5rem; color: #334155; }
.guide-detail-content h3 { font-size: 1.1rem; margin-top: 1rem; margin-bottom: 0.5rem; color: #475569; }
.guide-detail-content p { margin-bottom: 1rem; line-height: 1.6; color: #475569; }
.guide-detail-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 1rem 0; }
.guide-detail-content ul, .guide-detail-content ol { margin-bottom: 1rem; padding-left: 1.5rem; color: #475569; }
.guide-detail-content li { margin-bottom: 0.25rem; }
.guide-detail-content code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 0.875em; color: #0891B2; }
.guide-detail-content pre { background: #1e293b; color: #e2e8f0; padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 13px; }
.guide-detail-content a { color: #0891B2; }
.guide-detail-content a:hover { text-decoration: underline; }

/* Empty state */
.guides-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.guides-empty i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.guides-empty p {
    margin: 0;
    font-size: 14px;
}

/* ============================================
   RELEASES TAB CONTENT
   ============================================ */
.releases-tab-inner {
    height: 100%;
    overflow-y: auto;
    padding: 16px;
}

.release-item {
    margin-bottom: 20px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
}

.release-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.release-version {
    font-size: 18px;
    font-weight: 700;
    color: #0891B2;
}

.release-date {
    font-size: 12px;
    color: #64748b;
}

.release-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

.release-section {
    margin-bottom: 12px;
}

.release-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.release-section-header i {
    font-size: 14px;
}

.release-items {
    padding-left: 22px;
}

.release-items li {
    font-size: 13px;
    color: #475569;
    margin-bottom: 4px;
    line-height: 1.4;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .help-bubble-widget {
        bottom: 70px;
        left: 15px;
    }
    
    .help-bubble-button {
        width: 44px;
        height: 44px;
    }
    
    .help-bubble-panel {
        bottom: 70px;
        left: 10px;
        right: 10px;
        width: calc(100vw - 20px);
        max-height: calc(100vh - 90px);
        border-radius: 20px;
    }
    
    .help-panel-tab {
        padding: 10px 4px;
        font-size: 10px;
    }
    
    .help-panel-tab i {
        font-size: 14px;
    }
}

/* Hide when panel is open */
.help-bubble-widget.panel-open .help-bubble-button {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}
