/* Modern Forum Design - ChatGPT Style */

/* Forum Layout */
.forum-layout {
    display: flex;
    gap: 0;
    max-width: 1600px;
    margin: 0 auto;
    min-height: calc(100vh - 200px);
    background: #f9fafb;
}

/* Sidebar */
.forum-sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e5e7eb;
    border-radius: 12px;
    position: sticky;
    top: 0;
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.categories-nav {
    padding: 0.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Scrollbar styling for categories-nav */
.categories-nav::-webkit-scrollbar {
    width: 6px;
}

.categories-nav::-webkit-scrollbar-track {
    background: #f9fafb;
    border-radius: 3px;
}

.categories-nav::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.categories-nav::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    transition: all 0.15s ease;
    font-size: 0.9375rem;
    position: relative;
}

.category-item svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.category-item span:first-of-type {
    flex: 1;
}

.category-item .post-count {
    font-size: 0.8125rem;
    color: #9ca3af;
    font-weight: 500;
}

.category-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.category-item.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}

.category-item.active svg {
    opacity: 1;
}

.category-item.active .post-count {
    color: #2563eb;
}

/* Main Content */
.forum-main {
    flex: 1;
    max-width: 1100px;
}

.forum-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.forum-title h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    color: #111827;
}

.category-description {
    margin: 0.5rem 0 0;
    color: #6b7280;
    font-size: 0.9375rem;
}

.btn-new-post {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #2563eb;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-new-post:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* Section Titles */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1.25rem;
}

.section-title svg {
    color: #6b7280;
}

/* Hot Topics Section */
.hot-topics-section {
    margin-bottom: 2rem;
}

.hot-posts-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hot-post-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.hot-post-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #d1d5db;
}

.hot-post-link {
    display: block;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
}

.hot-post-header {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.hot-post-title {
    flex: 1;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hot-post-preview {
    margin: 0.75rem 0;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-category-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 6px;
    font-weight: 500;
    white-space: nowrap;
}

.hot-post-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.meta-author {
    margin-left: auto;
    font-size: 0.8125rem;
}

/* Latest Posts Section */
.latest-posts-section {
    margin-bottom: 2rem;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
    padding-bottom: 4rem;
}

/* Scrollbar styling for posts-list */
.posts-list::-webkit-scrollbar {
    width: 8px;
}

.posts-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.posts-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.posts-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.post-item {
    position: relative;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.post-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.post-item-link {
    display: block;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
}

.post-item-header {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.post-item-title {
    flex: 1;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-item-preview {
    margin: 0.75rem 0;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-item-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.post-author {
    font-weight: 500;
    color: #6b7280;
}

.post-category {
    padding: 0.125rem 0.5rem;
    background: #f3f4f6;
    border-radius: 4px;
    font-weight: 500;
}

.post-item-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
    padding-right: 0.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #9ca3af;
    font-size: 0.875rem;
    white-space: nowrap;
}

.stat-item svg {
    flex-shrink: 0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.5rem 0;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.pagination-current {
    color: #6b7280;
    font-size: 0.9375rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.empty-state svg {
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    color: #111827;
}

.empty-state p {
    color: #6b7280;
    margin: 0 0 1.5rem;
}

/* Form Styles */
.forum-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
    height: 90vh;
    overflow-y: auto;
}

.forum-header {
    margin-bottom: 2rem;
}

.forum-header h1 {
    margin: 0 0 0.5rem;
    color: #111827;
    font-size: 2rem;
}

.forum-subtitle {
    color: #6b7280;
    margin: 0;
    font-size: 0.9375rem;
}

.post-form-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
}

.post-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9375rem;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-help {
    font-size: 0.8125rem;
    color: #9ca3af;
}

.form-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.flash-messages-local {
    margin-bottom: 1.5rem;
}

/* Category Autocomplete */
.category-autocomplete {
    position: relative;
}

.category-search-input {
    width: 100%;
}

.category-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-top: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 50;
    display: none;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 0.9375rem;
}

.suggestion-item:hover {
    background: #f3f4f6;
}

.suggestion-item svg {
    flex-shrink: 0;
    color: #6b7280;
}

.suggestion-count {
    margin-left: auto;
    font-size: 0.8125rem;
    color: #9ca3af;
}

.suggestion-create {
    color: #2563eb;
    border-top: 1px solid #e5e7eb;
    font-weight: 500;
}

.suggestion-create:hover {
    background: #eff6ff;
}

.selected-category {
    margin-top: 0.75rem;
}

.selected-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.selected-badge.new {
    background: #f0fdf4;
    color: #16a34a;
}

.selected-badge svg {
    flex-shrink: 0;
}

/* Action Buttons (Delete, Edit, Reply) */
.post-action-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Delete Buttons */
.btn-delete {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: white;
    border: 1px solid #ef4444;
    border-radius: 6px;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
}

.btn-delete svg {
    flex-shrink: 0;
}

.btn-delete-small {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    background: white;
    border: 1px solid #f87171;
    border-radius: 4px;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-delete-small:hover {
    background: #fef2f2;
    border-color: #ef4444;
}

.btn-delete-small svg {
    flex-shrink: 0;
}

/* Edit Buttons */
.btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: white;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    color: #3b82f6;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-edit:hover {
    background: #eff6ff;
    border-color: #2563eb;
    color: #2563eb;
}

.btn-edit svg {
    flex-shrink: 0;
}

.btn-edit-small {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    background: white;
    border: 1px solid #93c5fd;
    border-radius: 4px;
    color: #3b82f6;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-edit-small:hover {
    background: #eff6ff;
    border-color: #3b82f6;
}

.btn-edit-small svg {
    flex-shrink: 0;
}

/* Reply Buttons */
.btn-reply {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-reply:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.btn-reply svg {
    flex-shrink: 0;
}

/* HAUPTKOMMENTARE - Weißes, modernes, elegantes Design */
.comment {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ANTWORTEN - Sanfte Farbe, modern, schlicht */
.comment.depth-1,
.comment.depth-2,
.comment.depth-3,
.comment.depth-4,
.comment.depth-5 {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 2px solid #cbd5e1;
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    box-shadow: none;
}

/* Indentation */
.comment.depth-1 {
    margin-left: 2.5rem;
}

.comment.depth-2 {
    margin-left: 5rem;
}

.comment.depth-3 {
    margin-left: 7.5rem;
}

.comment.depth-4 {
    margin-left: 10rem;
}

.comment.depth-5 {
    margin-left: 12.5rem;
}

/* Max depth indicator */
.comment.max-depth {
    margin-left: 12.5rem;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-author {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9375rem;
}

.comment-author.is-op {
    color: #2563eb;
}

.op-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comment-date {
    color: #9ca3af;
    font-size: 0.8125rem;
    margin-left: auto;
}

.comment-content {
    color: #1f2937;
    line-height: 1.7;
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
}

.comment-content .mention {
    color: #2563eb;
    font-weight: 500;
    text-decoration: none;
}

.comment-content .mention:hover {
    text-decoration: underline;
}

.reply-form-container {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
    display: none;
}

.reply-form-container.active {
    display: block;
}

.reply-form textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.reply-form textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.reply-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-cancel {
    padding: 0.5rem 0.875rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Edit Form Styles */
.edit-form-container {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: none;
}

.edit-form-container.active {
    display: block;
}

.edit-form input[type="text"],
.edit-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-family: inherit;
}

.edit-form input[type="text"]:focus,
.edit-form textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.edit-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .forum-layout {
        flex-direction: column;
    }

    .forum-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .categories-nav {
        max-height: none;
        overflow-y: visible;
    }

    .forum-main {
        padding: 1.5rem 1rem;
    }

    .forum-header-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .hot-posts-grid {
        grid-template-columns: 1fr;
    }

    .post-item-link {
        flex-direction: column;
        gap: 1rem;
    }

    .post-item-stats {
        flex-direction: row;
    }
}
