body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1f1f1f;
}

.help-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - 48px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.help-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: visible;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 100px);
}

.help-header {
    background: linear-gradient(135deg, #4c1d95 0%, #6b21a8 100%);
    color: #fff;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    border-bottom: 3px solid rgba(139, 92, 246, 0.4);
}

.help-header-content {
    flex: 1;
}

.help-header h1 {
    font-weight: 300;
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.help-header .lead {
    font-size: 0.95rem;
    opacity: 0.95;
    margin: 0;
}

.help-body {
    display: flex;
    flex: 1;
    overflow: visible;
    align-items: stretch;
}

.help-sidebar {
    background: #f8f9ff;
    border-right: 1px solid #eef0ff;
    padding: 20px 16px;
    width: 320px;
    min-width: 280px;
    overflow-y: auto;
    /* Let the sidebar background stretch with the content height (long pages) */
    max-height: none;
    align-self: stretch;
}

.help-content-wrapper {
    flex: 1;
    overflow: visible;
    max-width: 100%;
    min-width: 0;
}

.help-content {
    padding: 40px 48px;
    min-height: 100%;
    max-width: 100%;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.help-section-group {
    margin-bottom: 2px;
}

.help-section-item {
    padding: 8px 12px;
    margin: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
    font-size: 0.95rem;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
}

.help-section-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.help-section-item:hover {
    background: #fff;
    border-color: #eef0ff;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.help-section-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.help-section-item.active i {
    color: #fff;
}

.help-section-children {
    margin-left: 8px;
}

.help-section-item.subsection {
    padding-left: 24px;
    font-size: 0.9rem;
    margin: 1px 0;
    position: relative;
}

.help-section-item.subsection::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    width: 6px;
    height: 1px;
    background: #ddd;
}

.help-section-item.active.subsection::before {
    background: rgba(255, 255, 255, 0.5);
}

.help-section-item .toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.help-content-title {
    font-size: 2.4rem;
    font-weight: 300;
    margin-bottom: 24px;
    color: #333;
    padding-bottom: 16px;
    border-bottom: 2px solid #eef0ff;
}

.help-content-body {
    line-height: 1.8;
    color: #555;
    font-size: 1rem;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.help-content-body * {
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.help-content-body h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    margin-top: 32px;
    margin-bottom: 16px;
}

.help-content-body h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #444;
    margin-top: 24px;
    margin-bottom: 12px;
}

.help-content-body p {
    margin-bottom: 16px;
}

.help-content-body ul,
.help-content-body ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.help-content-body li {
    margin-bottom: 8px;
}

.help-content-body a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.help-content-body a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.help-content-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Embedded media + file tiles inside help content */
.help-content-body img,
.help-content-body video,
.help-content-body audio,
.help-content-body iframe,
.help-content-body embed,
.help-content-body object {
    /* Use !important so inline width/height from editor can't force overflow */
    max-width: 100% !important;
}

.help-content-body video,
.help-content-body audio {
    display: block;
    margin: 20px 0;
}

.help-content-body video {
    height: auto !important;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.help-content-body a[href^="/fstorage/"],
.help-content-body a[href*="/fstorage/"] {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    max-width: 100%;
    color: inherit;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

.help-content-body a[href^="/fstorage/"] *,
.help-content-body a[href*="/fstorage/"] * {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

.help-content-body a[href^="/fstorage/"]:hover,
.help-content-body a[href*="/fstorage/"]:hover {
    text-decoration: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.help-content-body a[href^="/fstorage/"] > strong:first-child,
.help-content-body a[href*="/fstorage/"] > strong:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background: #f8f9fa;
    color: #495057;
    font-weight: 700;
    font-size: 12px;
    overflow: hidden;
    flex: 0 0 auto;
}

.language-switcher {
    flex-shrink: 0;
}

.language-switcher .dropdown {
    position: relative;
}

.language-switcher .btn {
    border-radius: 12px !important;
    min-height: 44px;
    font-weight: 500;
    font-size: 1rem;
    box-shadow: none !important;
    background: #fff !important;
    color: #222 !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    transition: all 0.2s ease;
    padding: 8px 16px;
    white-space: nowrap;
}

.language-switcher .btn i {
    margin-right: 6px;
}

.language-switcher .btn:hover {
    background: #f8f9fa !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.language-switcher .btn:focus,
.language-switcher .btn:active {
    outline: none !important;
    box-shadow: 0 0 0 2px #764ba233 !important;
    background: #fff !important;
}

.language-switcher .dropdown-menu {
    border-radius: 12px !important;
    padding: 4px 0 !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
    background: #fff !important;
    border: none !important;
    min-width: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 8px;
}

.language-switcher .dropdown-item {
    border-radius: 8px;
    margin: 0;
    padding: 8px 16px;
    text-align: center;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    box-sizing: border-box;
}

.language-switcher .dropdown-item.active,
.language-switcher .dropdown-item:active {
    background-color: #764ba2 !important;
    color: #fff !important;
}

.language-switcher .dropdown-item:hover {
    background-color: #764ba2 !important;
    color: #fff !important;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

@media (max-width: 992px) {
    .help-body {
        flex-direction: column;
    }
    .help-sidebar {
        width: 100%;
        max-height: 300px;
        border-right: none;
        border-bottom: 1px solid #eef0ff;
    }
    .help-content-wrapper {
        overflow: visible;
    }
    .help-content {
        padding: 32px 24px;
    }
}

@media (max-width: 768px) {
    .help-container {
        padding: 16px;
    }
    .help-header {
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .help-header h1 {
        font-size: 1.5rem;
    }
    .language-switcher {
        width: 100%;
    }
    .language-switcher .btn {
        width: 100%;
    }
    .language-switcher .dropdown-menu {
        width: 100%;
    }
    .help-content {
        padding: 24px 16px;
    }
    .help-content-title {
        font-size: 1.8rem;
    }
}
