/* ===================================
   HELP PAGE STYLES - Teal Ocean Theme
   Using existing CSS variable system
   =================================== */

/* Help Container */
.help-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg);
}

/* Header */
.help-header {
    background: var(--surface);
    padding: var(--space-3xl) var(--space-2xl);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-2xl);
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.help-header h1 {
    margin: 0 0 var(--space-md) 0;
    font-size: var(--text-5xl);
    font-weight: var(--font-extrabold);
    color: var(--primary);
}

.help-header p {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin: 0;
}

/* Search Bar */
.help-search {
    max-width: 600px;
    margin: var(--space-xl) auto 0;
}

.help-search input {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    border: none;
    border-radius: var(--radius-full);
    font-size: var(--text-base);
    background: white;
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-base);
}

.help-search input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.3);
}

/* Guide Tabs */
.guide-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-2xl);
    border-bottom: 2px solid var(--border);
}

.guide-tab {
    padding: var(--space-md) var(--space-xl);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.guide-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.guide-tab:hover {
    color: var(--primary);
    background: rgba(20, 184, 166, 0.05);
}

/* Main Layout */
.help-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-2xl);
    align-items: start;
}

/* Table of Contents Sidebar */
.toc-sidebar {
    position: sticky;
    top: var(--space-lg);
    background: var(--surface);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.toc-sidebar h3 {
    margin: 0 0 var(--space-md) 0;
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--primary);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: var(--space-sm);
}

.toc-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color var(--transition-fast);
    display: block;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
}

.toc-list a:hover {
    color: var(--primary);
    background: rgba(20, 184, 166, 0.08);
}

.toc-list .level-3 {
    padding-left: var(--space-lg);
    font-size: var(--text-xs);
}

/* Content Area */
.help-content {
    background: var(--surface);
    padding: var(--space-3xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.guide-panel {
    display: none;
}

.guide-panel.active {
    display: block;
}

/* Section Styles */
.help-section {
    margin-bottom: var(--space-3xl);
    scroll-margin-top: 100px; /* Offset for sticky header */
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h2 {
    color: var(--primary);
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    margin: 0 0 var(--space-lg) 0;
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--border);
}

.help-section h3 {
    color: var(--primary);
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
    margin: var(--space-xl) 0 var(--space-md) 0;
}

.help-section h4 {
    color: var(--primary);
    font-size: var(--text-xl);
    font-weight: var(--font-medium);
    margin: var(--space-lg) 0 var(--space-sm) 0;
}

/* Markdown Content Styling */
.section-content p {
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-md);
    font-size: var(--text-base);
}

.section-content ul,
.section-content ol {
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-md);
    padding-left: var(--space-xl);
}

.section-content li {
    margin-bottom: var(--space-xs);
}

.section-content a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.section-content a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.section-content strong {
    color: var(--text-primary);
    font-weight: var(--font-semibold);
}

.section-content code {
    background: var(--background);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: var(--text-sm);
    color: var(--primary-dark);
    border: 1px solid var(--border);
}

.section-content pre {
    background: var(--background);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: var(--space-md);
    border: 1px solid var(--border);
}

.section-content pre code {
    background: none;
    padding: 0;
    border: none;
}

.section-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: var(--space-md);
    margin: var(--space-md) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.section-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-md);
}

.section-content th,
.section-content td {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    text-align: left;
}

.section-content th {
    background: var(--background);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: var(--space-2xl);
    right: var(--space-2xl);
    background: var(--gradient-primary);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-base);
    z-index: 100;
    font-size: var(--text-xl);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.back-to-top.visible {
    display: flex;
}

/* Chatbot Widget Styles */
.chatbot-container {
    position: fixed;
    bottom: var(--space-2xl);
    right: 100px;
    z-index: 1000;
}

.chatbot-toggle {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: all var(--transition-base);
}

.chatbot-toggle:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.chatbot-icon {
    font-size: var(--text-xl);
}

.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: var(--space-2xl);
    width: 400px;
    height: 600px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all var(--transition-base);
}

.chatbot-window.open {
    display: flex;
}

.chatbot-header {
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: var(--font-semibold);
    font-size: var(--text-lg);
}

.chatbot-clear {
    background: none;
    border: none;
    color: white;
    font-size: var(--text-lg);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.chatbot-clear:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: var(--text-2xl);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    background: var(--background);
}

.chatbot-message {
    display: flex;
    gap: var(--space-sm);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bot-message .message-content {
    background: var(--surface);
    padding: var(--space-md);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-sm);
    max-width: 85%;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-md);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg);
    max-width: 85%;
}

.user-message .message-content p {
    margin: 0;
    line-height: var(--leading-normal);
    color: white;
}

.bot-message .message-content p {
    margin: 0;
    line-height: var(--leading-normal);
    color: var(--text-secondary);
}

.message-sources {
    margin-top: var(--space-sm);
    padding: var(--space-sm);
    background: var(--background);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
}

.message-sources strong {
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--text-secondary);
}

.message-sources a {
    color: var(--primary);
    text-decoration: none;
}

.message-sources a:hover {
    text-decoration: underline;
}

.chatbot-loading {
    display: flex;
    gap: 5px;
    padding: var(--space-sm);
}

.chatbot-loading span {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--primary);
    animation: bounce 1.4s infinite ease-in-out;
}

.chatbot-loading span:nth-child(1) { animation-delay: -0.32s; }
.chatbot-loading span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.chatbot-input-container {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.chatbot-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    font-size: var(--text-sm);
    resize: none;
    font-family: inherit;
    max-height: 100px;
    transition: border-color var(--transition-fast);
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.chatbot-send {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    font-weight: var(--font-semibold);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.chatbot-send:hover {
    transform: scale(1.05);
}

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .help-layout {
        grid-template-columns: 1fr;
    }

    .toc-sidebar {
        position: relative;
        top: 0;
    }

    .help-header h1 {
        font-size: var(--text-4xl);
    }

    .help-content {
        padding: var(--space-xl);
    }

    .chatbot-window {
        width: 90%;
        right: 5%;
        left: 5%;
    }

    .chatbot-container {
        right: var(--space-lg);
    }
}
