/* ===================================
   Forum-Specific Styles
   (Theme base inherited from /assets/css/theme.css)
   =================================== */

/* Forum Container — centers the feed */
.forum-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

/* Stats Bar */
.forum-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.stat-item {
    background: var(--bg-elevated, #111);
    border: 1px solid var(--border-light, #222);
    border-radius: 10px;
    padding: 16px 24px;
    flex: 1;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-blue, #4285f4);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #777;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Filters Toolbar */
.forum-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.toolbar-filter select {
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #111;
    color: #ddd;
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 160px;
    transition: border-color 0.2s;
}

.toolbar-filter select:hover {
    border-color: var(--primary-blue, #4285f4);
}

.toolbar-filter select:focus {
    border-color: var(--primary-blue, #4285f4);
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.15);
}

/* Thread Feed */
.thread-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Thread Card — fully clickable */
.thread-card {
    display: block;
    background: var(--bg-elevated, #111);
    border: 1px solid var(--border-light, #222);
    border-radius: 10px;
    padding: 20px 24px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.15s;
}

.thread-card:hover {
    border-color: var(--primary-blue, #4285f4);
    box-shadow: 0 6px 24px rgba(66, 133, 244, 0.12);
    transform: translateY(-2px);
}

/* Card Header — avatar, author/date, comment badge */
.thread-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.thread-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue, #4285f4), #1a73e8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.thread-meta-info {
    flex: 1;
    min-width: 0;
}

.thread-author {
    display: block;
    font-weight: 600;
    color: #eee;
    font-size: 0.9rem;
}

.thread-date {
    display: block;
    font-size: 0.78rem;
    color: #666;
    margin-top: 1px;
}

.thread-comments-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(66, 133, 244, 0.1);
    color: var(--primary-blue, #4285f4);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* Card Content */
.thread-title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
}

.thread-card:hover .thread-title {
    color: var(--primary-blue, #4285f4);
}

.thread-excerpt {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: #999;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thread-read-more {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-blue, #4285f4);
    transition: color 0.2s;
}

.thread-card:hover .thread-read-more {
    color: var(--primary-yellow, #fbbc05);
}

/* No Threads */
.no-threads {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-threads p {
    font-size: 1rem;
    margin-top: 8px;
}

/* ===================================
   Thread Detail Page (thread.php)
   =================================== */

article {
    background: var(--bg-elevated, #111);
    border: 1px solid var(--border-light, #222);
    padding: 24px;
    border-radius: 10px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px;
}

article .title,
article h2 {
    margin-top: 0;
    font-size: 1.6rem;
    color: #fff;
    line-height: 1.3;
}

article .content,
article p {
    line-height: 1.7;
    color: #ccc;
}

article .metas {
    font-size: 0.85rem;
    color: #888;
    margin: 12px 0 0;
}

article a {
    color: var(--primary-blue, #4285f4);
    text-decoration: none;
}

article a:hover {
    color: var(--primary-yellow, #fbbc05);
}

/* Comment Form */
.submit-comment {
    background: var(--bg-elevated, #111);
    border: 1px solid var(--border-light, #222);
    padding: 24px;
    border-radius: 10px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px;
}

.submit-comment h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #fff;
}

.submit-comment form {
    display: flex;
    flex-direction: column;
}

.submit-comment input,
.submit-comment textarea {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #0a0a0a;
    color: #eee;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.submit-comment input:focus,
.submit-comment textarea:focus {
    border-color: var(--primary-blue, #4285f4);
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.15);
}

.submit-comment button {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, var(--primary-blue, #4285f4), #1a73e8);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
}

.submit-comment button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

/* Comments Section */
.comments {
    background: var(--bg-elevated, #111);
    border: 1px solid var(--border-light, #222);
    padding: 24px;
    border-radius: 10px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px;
}

.comments h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #fff;
}

.comments ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comments li {
    border-bottom: 1px solid #1a1a1a;
    padding: 14px 0;
}

.comments li:last-child {
    border-bottom: none;
}

.comments strong {
    color: var(--primary-blue, #4285f4);
}

.comments small {
    color: #666;
    font-size: 0.8rem;
}

.comments p {
    color: #ccc;
    line-height: 1.6;
}

/* Related Threads */
.related-threads {
    background: var(--bg-elevated, #111);
    border: 1px solid var(--border-light, #222);
    padding: 24px;
    border-radius: 10px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px;
}

.related-threads h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #fff;
}

.related-threads ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-threads li {
    margin-bottom: 10px;
}

.related-threads a {
    color: var(--primary-blue, #4285f4);
    text-decoration: none;
    transition: color 0.2s;
}

.related-threads a:hover {
    color: var(--primary-yellow, #fbbc05);
}

/* ===================================
   Submit Thread Page
   =================================== */

main>form {
    background: var(--bg-elevated, #111);
    border: 1px solid var(--border-light, #222);
    border-radius: 10px;
    padding: 28px;
    max-width: 600px;
    width: 100%;
    margin: 30px auto;
}

main>form input[type="text"],
main>form textarea,
main>form select {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 14px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #0a0a0a;
    color: #eee;
    box-sizing: border-box;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

main>form input[type="text"]:focus,
main>form textarea:focus,
main>form select:focus {
    border-color: var(--primary-blue, #4285f4);
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.15);
}

main>form textarea {
    height: 150px;
    resize: vertical;
}

main>form button {
    background: linear-gradient(135deg, var(--primary-blue, #4285f4), #1a73e8);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    transition: all 0.2s;
}

main>form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

main>form .message {
    margin-bottom: 14px;
    color: var(--primary-green, #34a853);
    font-weight: 600;
    padding: 10px 14px;
    background: rgba(52, 168, 83, 0.1);
    border: 1px solid rgba(52, 168, 83, 0.3);
    border-radius: 8px;
}

main>form .go-back {
    margin-top: 10px;
    background: #1a1a1a;
    color: #ccc;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    display: inline-block;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
}

main>form .go-back:hover {
    background: #222;
    color: #fff;
}

/* Thread detail main layout */
main {
    display: block;
    padding: 24px 20px 40px;
    max-width: 820px;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
    .forum-container {
        padding: 16px 12px 30px;
    }

    .forum-stats {
        gap: 10px;
    }

    .stat-item {
        padding: 12px 16px;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .thread-card {
        padding: 16px;
    }

    .thread-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    article,
    .submit-comment,
    .comments,
    .related-threads {
        max-width: none;
    }

    main {
        padding: 16px 12px 30px;
    }
}