/* Forum Styles */

/* Container */
.forum-container {
    max-width: 1400px;
}

/* Header */
.forum-header {
    background: linear-gradient(135deg, #1e2130 0%, #2d3148 100%);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.forum-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.forum-subtitle {
    font-size: 0.95rem;
}

.forum-actions .btn {
    padding: 10px 20px;
    font-weight: 500;
}

/* Category */
.forum-category {
    background: #1e2130;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(102, 126, 234, 0.05) 100%);
    border-left: 4px solid #667eea;
}

.category-icon {
    font-size: 1.5rem;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.category-desc {
    font-size: 0.85rem;
    color: #a0a0a0;
    margin-top: 5px;
}

/* Forum Item */
.forums-list {
    padding: 0;
}

.forum-item {
    display: grid;
    grid-template-columns: 50px 1fr auto auto;
    gap: 20px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
    transition: background 0.2s;
}

.forum-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.forum-item.empty {
    display: block;
    text-align: center;
    padding: 30px;
}

.forum-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.forum-info {
    flex: 1;
}

.forum-name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
}

.forum-name:hover {
    color: #667eea;
}

.forum-desc {
    font-size: 0.85rem;
    color: #a0a0a0;
    margin-top: 5px;
}

.sub-forums {
    font-size: 0.8rem;
}

.sub-forum-link {
    color: #667eea;
    text-decoration: none;
}

.sub-forum-link:hover {
    text-decoration: underline;
}

/* Forum Stats */
.forum-stats {
    display: flex;
    gap: 30px;
}

.forum-stats .stat {
    text-align: center;
}

.forum-stats .stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.forum-stats .stat-label {
    display: block;
    font-size: 0.75rem;
    color: #a0a0a0;
    text-transform: uppercase;
}

/* Last Post */
.forum-last-post {
    min-width: 200px;
    max-width: 250px;
}

.last-post-info {
    font-size: 0.85rem;
}

.last-topic-title {
    color: #fff;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.last-topic-title:hover {
    color: #667eea;
}

.last-post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #a0a0a0;
}

.last-post-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

/* Sidebar */
.forum-sidebar-box {
    background: #1e2130;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
}

.stat-item i {
    font-size: 1.2rem;
    color: #667eea;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.stat-text {
    font-size: 0.75rem;
    color: #a0a0a0;
}

/* Recent Topics */
.recent-topics-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recent-topic-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.recent-topic-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    flex-shrink: 0;
}

.recent-topic-info {
    flex: 1;
    min-width: 0;
}

.recent-topic-title {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-topic-title:hover {
    color: #667eea;
}

.recent-topic-meta {
    font-size: 0.8rem;
    color: #a0a0a0;
    margin-top: 3px;
}

/* ==================== Forum View Page ==================== */
.forum-view-header {
    background: linear-gradient(135deg, #1e2130 0%, #2d3148 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.forum-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.forum-breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.forum-breadcrumb a:hover {
    text-decoration: underline;
}

.forum-breadcrumb span {
    color: #a0a0a0;
}

.forum-view-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.forum-view-desc {
    color: #a0a0a0;
    margin-top: 10px;
    margin-bottom: 0;
}

/* Topics List */
.topics-list {
    background: #1e2130;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.topics-list-header {
    display: grid;
    grid-template-columns: 1fr 100px 100px 200px;
    gap: 20px;
    padding: 15px 20px;
    background: rgba(102, 126, 234, 0.1);
    font-weight: 600;
    font-size: 0.85rem;
    color: #a0a0a0;
    text-transform: uppercase;
}

.topic-item {
    display: grid;
    grid-template-columns: 1fr 100px 100px 200px;
    gap: 20px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
    transition: background 0.2s;
}

.topic-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.topic-item.sticky {
    background: rgba(245, 158, 11, 0.1);
}

.topic-item.announcement {
    background: rgba(16, 185, 129, 0.1);
}

.topic-info {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.topic-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    flex-shrink: 0;
}

.topic-details {
    flex: 1;
    min-width: 0;
}

.topic-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topic-title:hover {
    color: #667eea;
}

.topic-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.topic-badge.sticky {
    background: #f59e0b;
    color: #000;
}

.topic-badge.announcement {
    background: #10b981;
    color: #fff;
}

.topic-badge.locked {
    background: #ef4444;
    color: #fff;
}

.topic-meta {
    font-size: 0.8rem;
    color: #a0a0a0;
    margin-top: 5px;
}

.topic-meta a {
    color: #667eea;
    text-decoration: none;
}

.topic-stat {
    text-align: center;
    font-size: 0.95rem;
    color: #fff;
}

.topic-last-post {
    font-size: 0.85rem;
}

.topic-last-post .username {
    color: #667eea;
    font-weight: 500;
}

/* ==================== Topic View Page ==================== */
.topic-header {
    background: linear-gradient(135deg, #1e2130 0%, #2d3148 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.topic-title-main {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Posts */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-item {
    background: #1e2130;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.post-item.first-post {
    border-left: 3px solid #667eea;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(102, 126, 234, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.post-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-author-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

.post-author-name {
    font-weight: 600;
    color: #fff;
}

.post-author-meta {
    font-size: 0.8rem;
    color: #a0a0a0;
}

.post-date {
    font-size: 0.85rem;
    color: #a0a0a0;
}

.post-body {
    padding: 20px;
}

.post-content {
    color: #e0e0e0;
    line-height: 1.7;
    font-size: 0.95rem;
}

.post-content img {
    max-width: 100%;
    border-radius: 8px;
}

.post-content a {
    color: #667eea;
}

.post-content blockquote {
    background: rgba(102, 126, 234, 0.1);
    border-left: 3px solid #667eea;
    padding: 15px;
    border-radius: 0 8px 8px 0;
    margin: 15px 0;
}

.post-signature {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: #a0a0a0;
    font-style: italic;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
}

.post-actions {
    display: flex;
    gap: 10px;
}

.post-action-btn {
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-action-btn.like-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.post-action-btn.like-btn:hover,
.post-action-btn.like-btn.liked {
    background: #ef4444;
    color: #fff;
}

.post-action-btn.quote-btn {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.post-action-btn.quote-btn:hover {
    background: #667eea;
    color: #fff;
}

.post-action-btn.edit-btn {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.post-action-btn.edit-btn:hover {
    background: #f59e0b;
    color: #000;
}

.post-action-btn.delete-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.post-action-btn.delete-btn:hover {
    background: #ef4444;
    color: #fff;
}

.post-likes {
    font-size: 0.85rem;
    color: #ef4444;
}

/* Reply Form */
.reply-form-container {
    background: #1e2130;
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.reply-form-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Editor */
.editor-container {
    background: #0f1219;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px;
    background: rgba(102, 126, 234, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.editor-btn {
    width: 35px;
    height: 35px;
    border-radius: 6px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-btn:hover {
    background: #667eea;
}

.editor-btn.active {
    background: #667eea;
}

.editor-divider {
    width: 1px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 5px;
}

.editor-textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
}

.editor-textarea:focus {
    outline: none;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
}

.emoji-picker-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.emoji-picker-btn:hover {
    background: #f59e0b;
    color: #000;
}

.submit-post-btn {
    padding: 12px 30px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-post-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #1e2130;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    width: 320px;
    max-height: 300px;
    overflow-y: auto;
}

.emoji-picker.show {
    display: block;
}

.emoji-category {
    margin-bottom: 15px;
}

.emoji-category-title {
    font-size: 0.8rem;
    color: #a0a0a0;
    margin-bottom: 10px;
    font-weight: 600;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.emoji-item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.emoji-item:hover {
    background: rgba(102, 126, 234, 0.3);
    transform: scale(1.2);
}

/* New Topic Form */
.new-topic-form {
    background: #1e2130;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: #0f1219;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

.form-select {
    width: 100%;
    padding: 12px 15px;
    background: #0f1219;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
}

/* Pagination */
.forum-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.forum-pagination .page-link {
    padding: 10px 15px;
    background: #1e2130;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
}

.forum-pagination .page-link:hover,
.forum-pagination .page-link.active {
    background: #667eea;
    border-color: #667eea;
}

/* Responsive */
@media (max-width: 992px) {
    .forum-item {
        grid-template-columns: 50px 1fr;
    }
    
    .forum-stats,
    .forum-last-post {
        display: none;
    }
    
    .topics-list-header {
        display: none;
    }
    
    .topic-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .topic-stat,
    .topic-last-post {
        display: none;
    }
}

@media (max-width: 576px) {
    .forum-header {
        padding: 20px;
    }
    
    .forum-title {
        font-size: 1.4rem;
    }
    
    .category-header {
        padding: 15px;
    }
    
    .forum-item {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Quote styling */
.post-content blockquote,
.post-content .quote-block {
    background: rgba(0, 0, 0, 0.4);
    border-left: 4px solid #667eea;
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #a0a0a0;
}

.post-content blockquote strong,
.post-content .quote-block strong {
    color: #667eea;
    font-style: normal;
}

/* User online status indicator */
.post-author-avatar {
    position: relative;
}

.post-author-avatar.online {
    border: 3px solid #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.post-author-avatar.offline {
    border: 3px solid #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.recent-topic-avatar.online,
.last-post-avatar.online {
    border: 2px solid #10b981;
}

.recent-topic-avatar.offline,
.last-post-avatar.offline {
    border: 2px solid #ef4444;
}

.topic-avatar.online {
    border: 2px solid #10b981;
}

.topic-avatar.offline {
    border: 2px solid #ef4444;
}
