/**
 * wavbox.io - Forum CSS
 * Comprehensive Discord-inspired forum styling
 */

/* ============================================================================
   FORUM LAYOUT & CONTAINERS
   ============================================================================ */

.forum-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.forum-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.forum-breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.forum-breadcrumb a:hover {
    color: #000;
}

body.dark-mode .forum-breadcrumb a {
    color: #999;
}

body.dark-mode .forum-breadcrumb a:hover {
    color: #fff;
}

/* ============================================================================
   CATEGORY CARDS
   ============================================================================ */

.forum-category-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #000;
    border-radius: 4px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    animation: slideInFromBottom 0.4s ease backwards;
}

.forum-category-card:hover {
    border-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

body.dark-mode .forum-category-card {
    background: #1a1a1a;
    border-color: #333;
}

body.dark-mode .forum-category-card:hover {
    border-left-color: #fff;
    box-shadow: 0 4px 12px rgba(255,255,255,0.1);
}

.category-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.category-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.category-info {
    flex: 1;
}

.category-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #000;
}

body.dark-mode .category-name {
    color: #fff;
}

.category-description {
    color: #666;
    margin: 0;
    font-size: 0.875rem;
}

body.dark-mode .category-description {
    color: #999;
}

.category-stats {
    display: flex;
    gap: 2rem;
    padding: 1rem 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 1rem;
}

body.dark-mode .category-stats {
    border-color: #333;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #000;
}

body.dark-mode .stat-value {
    color: #fff;
}

.stat-label {
    font-size: 0.75rem;
    color: #999;
}

.category-latest {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    gap: 1rem;
}

.latest-post-info {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================================
   THREAD ROWS
   ============================================================================ */

.forum-threads-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.forum-thread-row {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1rem 1.5rem;
    transition: all 0.2s ease;
}

.forum-thread-row:hover {
    border-color: #000;
    background: #fafafa;
}

.forum-thread-row.pinned {
    background: #fffbf0;
    border-color: #ffd700;
}

.forum-thread-row.locked {
    opacity: 0.7;
}

body.dark-mode .forum-thread-row {
    background: #1a1a1a;
    border-color: #333;
}

body.dark-mode .forum-thread-row:hover {
    background: #222;
    border-color: #555;
}

body.dark-mode .forum-thread-row.pinned {
    background: #2a2416;
    border-color: #ffd700;
}

.thread-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.thread-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
}

.thread-status {
    display: flex;
    gap: 0.25rem;
}

.thread-badge {
    font-size: 1rem;
}

.thread-info {
    flex: 1;
    min-width: 0;
}

.thread-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0 0 0.25rem 0;
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.dark-mode .thread-title {
    color: #fff;
}

.thread-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #666;
}

body.dark-mode .thread-meta {
    color: #999;
}

.thread-stats {
    display: flex;
    gap: 1.5rem;
}

.stat-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.stat-compact .stat-value {
    font-size: 1.125rem;
}

.thread-latest {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    font-size: 0.875rem;
    min-width: 150px;
}

/* ============================================================================
   CATEGORY & THREAD HEADERS
   ============================================================================ */

.forum-category-header,
.forum-thread-header {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

body.dark-mode .forum-category-header,
body.dark-mode .forum-thread-header {
    background: #1a1a1a;
    border-color: #333;
    color: #fff;
}

.category-stats-bar {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

body.dark-mode .category-stats-bar {
    border-color: #333;
}

/* ============================================================================
   POST CARDS (Main content)
   ============================================================================ */

.forum-posts-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.forum-post-card {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 1.25rem 0;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    animation: slideInFromBottom 0.3s ease backwards;
}

body.dark-mode .forum-post-card {
    background: #000;
    border-color: #333;
}

.post-author-section {
    flex-shrink: 0;
    padding-top: 0.25rem;
}

.post-author-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.post-author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

body.dark-mode .post-author-avatar {
    border-color: #333;
}

.post-author-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
}

.post-author-name {
    font-size: 0.875rem;
    font-weight: 600;
}

.post-author-meta {
    font-size: 0.75rem;
    color: #999;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.badge-bronze,
.badge-silver,
.badge-gold,
.badge-platinum,
.badge-diamond {
    font-size: 0.875rem;
    padding: 0.125rem 0.375rem;
    border-radius: 2px;
}

.badge-bronze { background: #cd7f32; color: white; }
.badge-silver { background: #c0c0c0; color: #333; }
.badge-gold { background: #ffd700; color: #333; }
.badge-platinum { background: #e5e4e2; color: #333; }
.badge-diamond { background: #b9f2ff; color: #333; }

.post-content-section {
    flex: 1;
}

.post-content {
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #333;
    word-wrap: break-word;
}

body.dark-mode .post-content {
    color: #ddd;
}

.post-content code {
    background: #f5f5f5;
    padding: 0.125rem 0.375rem;
    border-radius: 2px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

body.dark-mode .post-content code {
    background: #2a2a2a;
    color: #fff;
}

.post-edited {
    font-size: 0.75rem;
    color: #999;
    font-style: italic;
    margin-bottom: 0.5rem;
}

.forum-quote {
    border-left: 3px solid #ddd;
    padding-left: 1rem;
    margin: 0.5rem 0;
    color: #666;
    font-style: italic;
}

body.dark-mode .forum-quote {
    border-color: #555;
    color: #999;
}

/* ============================================================================
   REACTIONS & VOTING
   ============================================================================ */

.post-reactions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

body.dark-mode .post-reactions-bar {
    border-color: #333;
}

.reaction-bubble {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.reaction-bubble:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

body.dark-mode .reaction-bubble {
    background: #2a2a2a;
    border-color: #444;
    color: #fff;
}

body.dark-mode .reaction-bubble:hover {
    background: #333;
}

.add-reaction-btn {
    background: transparent;
    border: 1px dashed #ccc;
    border-radius: 20px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    color: #999;
    transition: all 0.2s;
}

.add-reaction-btn:hover {
    border-color: #000;
    color: #000;
}

body.dark-mode .add-reaction-btn:hover {
    border-color: #fff;
    color: #fff;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
}

.post-timestamp {
    font-size: 0.875rem;
    color: #999;
}

.post-actions {
    display: flex;
    gap: 1rem;
}

.post-action-btn {
    background: transparent;
    border: none;
    color: #666;
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.post-action-btn:hover {
    background: #f5f5f5;
    color: #000;
}

body.dark-mode .post-action-btn {
    color: #999;
}

body.dark-mode .post-action-btn:hover {
    background: #2a2a2a;
    color: #fff;
}

.post-action-btn.upvote-btn:hover {
    color: #4caf50;
}

.post-action-btn.downvote-btn:hover {
    color: #f44336;
}

.post-action-btn.delete-btn:hover {
    color: #f44336;
    background: #fff5f5;
}

body.dark-mode .post-action-btn.delete-btn:hover {
    background: #3a1a1a;
}

/* ============================================================================
   REPLIES (Nested comments)
   ============================================================================ */

.post-replies {
    margin-top: 1rem;
    padding-left: 2rem;
    border-left: 2px solid #e0e0e0;
}

body.dark-mode .post-replies {
    border-color: #333;
}

.forum-reply-card {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 0.75rem 0;
    margin-bottom: 0;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

body.dark-mode .forum-reply-card {
    background: #000;
    border-color: #333;
}

.reply-author-section {
    flex-shrink: 0;
    padding-top: 0.25rem;
}

.reply-author-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    margin-bottom: 0.5rem;
}

.reply-author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

body.dark-mode .reply-author-avatar {
    border-color: #333;
}

.reply-content {
    line-height: 1.5;
    margin-bottom: 0.5rem;
    color: #333;
}

body.dark-mode .reply-content {
    color: #ddd;
}

.reply-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.inline-reply-form {
    margin-top: 1rem;
    padding: 1rem;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

body.dark-mode .inline-reply-form {
    background: #1a1a1a;
    border-color: #333;
}

.inline-reply-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.875rem;
    resize: vertical;
}

body.dark-mode .inline-reply-form textarea {
    background: #0f0f0f;
    border-color: #444;
    color: #fff;
}

/* ============================================================================
   REPLY FORM
   ============================================================================ */

.forum-reply-form {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

body.dark-mode .forum-reply-form {
    background: #1a1a1a;
    border-color: #333;
}

.forum-reply-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 1rem;
    resize: vertical;
    min-height: 120px;
}

body.dark-mode .forum-reply-form textarea {
    background: #0f0f0f;
    border-color: #444;
    color: #fff;
}

.forum-locked-notice,
.forum-login-notice {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
    color: #666;
}

body.dark-mode .forum-locked-notice,
body.dark-mode .forum-login-notice {
    background: #1a1a1a;
    border-color: #333;
    color: #999;
}

/* ============================================================================
   MODALS
   ============================================================================ */

.forum-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.forum-modal-content {
    background: white;
    border-radius: 4px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body.dark-mode .forum-modal-content {
    background: #1a1a1a;
}

.forum-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

body.dark-mode .forum-modal-header {
    border-color: #333;
}

.forum-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.forum-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.forum-modal-close:hover {
    background: #f5f5f5;
    color: #000;
}

body.dark-mode .forum-modal-close:hover {
    background: #2a2a2a;
    color: #fff;
}

.forum-modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

body.dark-mode .form-group label {
    color: #ddd;
}

.form-group input[type="text"],
.form-group input[type="color"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 1rem;
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
    background: #0f0f0f;
    border-color: #444;
    color: #fff;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ============================================================================
   EMOJI PICKER
   ============================================================================ */

.emoji-picker-content {
    max-width: 400px;
}

.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.emoji-btn {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0.75rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.emoji-btn:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

body.dark-mode .emoji-btn {
    background: #2a2a2a;
    border-color: #444;
}

body.dark-mode .emoji-btn:hover {
    background: #333;
}

/* ============================================================================
   SEARCH
   ============================================================================ */

.forum-search-bar {
    margin-bottom: 2rem;
}

.search-results {
    padding: 1rem 0;
}

.search-section {
    margin-bottom: 2rem;
}

.search-section h4 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
    color: #666;
}

body.dark-mode .search-section h4 {
    color: #999;
}

.search-result-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 0.5rem;
}

body.dark-mode .search-result-item {
    background: #1a1a1a;
    border-color: #333;
}

.search-result-item a {
    color: #000;
    text-decoration: none;
    font-weight: 500;
}

.search-result-item a:hover {
    text-decoration: underline;
}

body.dark-mode .search-result-item a {
    color: #fff;
}

/* ============================================================================
   PAGINATION
   ============================================================================ */

.forum-pagination {
    margin: 2rem 0;
}

.pagination-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

/* ============================================================================
   EMPTY & ERROR STATES
   ============================================================================ */

.empty-state,
.error-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
    font-size: 1.125rem;
}

.error-state {
    color: #f44336;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .forum-post-card {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .post-author-section {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }
    
    .post-author-avatar {
        width: 48px;
        height: 48px;
    }
    
    .thread-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .thread-stats,
    .thread-latest {
        width: 100%;
    }
    
    .post-replies {
        padding-left: 1rem;
    }
    
    .category-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}
