/* Forum styles */

body {
    font-family: Arial, sans-serif;
}

/* Modal font override */
.modal-box,
.modal-box * {
    font-family: Arial, sans-serif !important;
}

.forum-filters {
    display: flex !important;
    gap: 15px !important;
    margin-bottom: 20px !important;
    align-items: center !important;
    position: relative;
    z-index: 1;
}

.forum-filters #searchInput {
    flex: 0 0 auto !important;
    padding: 12px 15px !important;
    border: 2px solid #ccc !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    background: white !important;
    font-family: Arial, sans-serif !important;
    color: #333 !important;
    transition: all 0.2s;
    width: 320px !important;
    max-width: 320px !important;
}

.forum-filters #searchInput::placeholder {
    color: #999 !important;
    opacity: 1 !important;
}

.forum-filters #searchInput:focus {
    outline: none;
    border-color: #4a90e2 !important;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1) !important;
}

.forum-filters #sortSelect {
    padding: 10px 15px !important;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    font-size: 14px !important;
    background: white !important;
    cursor: pointer !important;
    min-width: 180px !important;
    width: auto !important;
    flex: 0 0 auto !important;
}

/* Thread List */
.thread-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.thread-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.thread-card.sub-thread {
    margin-left: 40px;
    background: #f8f9fa;
    border-left: 3px solid #6c757d;
    position: relative;
}

.thread-card.sub-thread.depth-2 {
    margin-left: 80px;
    background: #e9ecef;
    border-left: 3px solid #495057;
}

.thread-card.sub-thread.depth-3 {
    margin-left: 120px;
    background: #dee2e6;
    border-left: 3px solid #343a40;
}

.thread-card.sub-thread::before {
    content: "↳";
    position: absolute;
    left: -30px;
    top: 20px;
    font-size: 20px;
    color: #6c757d;
}

.thread-card.sub-thread.depth-2::before {
    content: "↳↳";
    left: -35px;
}

.thread-card.sub-thread.depth-3::before {
    content: "↳↳↳";
    left: -40px;
}

.thread-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.thread-card.pinned {
    background: linear-gradient(to right, #fff3cd 0%, white 50px);
    border-left: 4px solid #ffc107;
}

.thread-card.locked {
    opacity: 0.7;
}

.thread-card.deleted {
    background: #f8f9fa;
    opacity: 0.6;
    border-left: 4px solid #6c757d;
}

.thread-card.deleted .thread-title {
    color: #6c757d;
    text-decoration: line-through;
}

.thread-card.deleted:hover {
    opacity: 0.75;
}

.thread-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.thread-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 5px 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.thread-notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #dc3545;
    color: white;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 5px;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.thread-badges {
    display: flex;
    gap: 5px;
    align-items: center;
}

.badge {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.badge.pinned {
    background: #ffc107;
    color: #333;
}

.badge.locked {
    background: #dc3545;
    color: white;
}

.badge.deleted {
    background: #6c757d;
    color: white;
}

.restore-btn {
    padding: 4px 10px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.restore-btn:hover {
    background: #218838;
}

.thread-meta {
    font-size: 13px;
    color: #6c757d;
    text-align: right;
    white-space: nowrap;
}

.thread-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    gap: 16px;
}

.thread-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
    flex-shrink: 0;
}

.thread-stats span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Pagination */
/* Thread breadcrumb */
.thread-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #6c757d;
    flex-wrap: wrap;
}

.thread-breadcrumb a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.thread-breadcrumb a:hover {
    text-decoration: underline;
}

.thread-breadcrumb .separator {
    color: #adb5bd;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination button {
    padding: 8px 15px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
}

.pagination button:hover:not(:disabled) {
    background: #f8f9fa;
}

.pagination button.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Thread header in modal */
.thread-header {
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.thread-header h2 {
    margin: 10px 0;
    color: #2c3e50;
}

.admin-controls {
    margin-top: 10px;
}

/* Posts List */
.posts-list {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.post-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.post-card.deleted {
    background: #f8f9fa;
    opacity: 0.7;
    border-left: 4px solid #6c757d;
}

.post-card.deleted .post-body.deleted-text {
    color: #6c757d;
    text-decoration: line-through;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
}

.author-name {
    font-weight: 600;
    color: #2c3e50;
}

.post-time {
    color: #6c757d;
}

.edited-badge {
    color: #6c757d;
    font-style: italic;
    margin-left: 5px;
}

.post-body {
    color: #2c3e50;
    line-height: 1.6;
    white-space: pre-wrap;
}

.post-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.edit-btn, .delete-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 13px;
    padding: 5px 10px;
}

.edit-btn:hover {
    text-decoration: underline;
}

.delete-btn {
    color: #dc3545;
}

.delete-btn:hover {
    text-decoration: underline;
}

/* Reply Box */
.reply-box {
    border-top: 2px solid #e0e0e0;
    padding-top: 20px;
}

.reply-box textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
    margin-bottom: 10px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

/* Modal overlays using existing system */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-overlay.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .forum-filters {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
    }
    
    .forum-filters #searchInput {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .forum-filters #sortSelect {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    .thread-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .thread-meta {
        text-align: left;
        white-space: normal;
    }
    
    .thread-stats {
        gap: 12px;
    }

    .posts-list {
        max-height: 400px;
    }
}
/* Sub-threads section in thread view modal */
.sub-threads-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.sub-threads-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.2em;
}

.sub-threads-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sub-thread-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-left: 3px solid #6c757d;
    border-radius: 6px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.sub-thread-card:hover {
    background: #e9ecef;
    border-left-color: #495057;
    transform: translateX(3px);
}

.sub-thread-header h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1em;
}

.sub-thread-meta {
    font-size: 0.85em;
    color: #6c757d;
}