/* =========================================
   DISCUSSION FORUM STYLES
   Reddit-like design for movie discussions
   ========================================= */

.forum-container {
    display: flex;
    margin: 70px auto 0;
    gap: 20px;
    padding: 20px;
    width: min(100%, 1400px);
}

/* Sidebar: Movies List */
.forum-sidebar {
    width: 300px;
    flex: 0 0 300px;
    min-width: 260px;
    align-self: flex-start;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 90px;
    box-shadow: var(--shadow-md);
}

.sidebar-header {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-header h2 {
    font-size: 1.3rem;
    margin-bottom: 0;
    color: var(--text-primary);
}

.add-thread-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.add-thread-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.4);
}

.add-thread-btn span {
    font-size: 1.5rem;
    font-weight: bold;
}

.movies-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 70vh;
    overflow-y: auto;
}

.movie-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.movie-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent-secondary);
}

.movie-item.active {
    background: #000000;
    color: #fff;
    border-color: #2f2f2f;
}

.movie-item-poster {
    width: 50px;
    height: 75px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg-secondary);
}

.movie-item-info h4 {
    font-size: 0.95rem;
    margin: 0;
    color: var(--text-primary);
}

.movie-item.active .movie-item-info h4 {
    color: #fff;
}

.movie-item-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 4px 0 0 0;
}

.movie-item.active .movie-item-info p {
    color: rgba(255, 255, 255, 0.7);
}

/* Main Content Area */
.forum-main {
    flex: 1;
    min-width: 0;
}

.forum-header {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.forum-info h1 {
    font-size: 1.8rem;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.forum-info p {
    color: var(--text-muted);
    margin: 0;
}

.create-thread-btn {
    padding: 12px 24px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.create-thread-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.4);
}

/* Threads Container */
.threads-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Individual Thread Card */
.thread-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    gap: 15px;
    box-shadow: var(--shadow-sm);
}

.thread-card:hover {
    border-color: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.thread-votes-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 50px;
}

.vote-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.vote-btn:hover {
    background: var(--bg-hover);
}

.vote-btn.upvote.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.vote-btn.downvote.active {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.vote-score {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.thread-content {
    flex: 1;
}

.thread-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.thread-delete-btn {
    margin-left: auto;
    background: transparent;
    border: 1px solid #333;
    color: #aaa;
    border-radius: 6px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.thread-delete-btn:hover {
    border-color: #f44336;
    color: #f96d00;
}

.thread-detail-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.thread-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--bg-secondary);
}

.thread-info {
    flex: 1;
}

.thread-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: var(--text-primary);
}

.thread-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.thread-description {
    color: var(--text-secondary);
    margin: 12px 0;
    line-height: 1.5;
}

.thread-stats {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 12px;
}

.thread-stat {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Thread Detail Modal */
.thread-detail {
    max-height: 90vh;
    overflow: hidden;
}

.thread-detail .settings-content {
    max-height: 90vh;
}

.thread-detail .modal-body {
    padding: 0;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #f96d00 #111;
}

.thread-detail .modal-body::-webkit-scrollbar {
    width: 8px;
}

.thread-detail .modal-body::-webkit-scrollbar-track {
    background: #111;
}

.thread-detail .modal-body::-webkit-scrollbar-thumb {
    background-color: #f96d00;
    border-radius: 10px;
}

.thread-detail img#threadDetailImage {
    max-height: 40vh;
    object-fit: contain;
}

.thread-detail-content {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.thread-detail-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.thread-votes {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Create Thread Description Input */
#createThreadModal .input-group textarea {
    width: 100%;
    min-height: 140px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 12px;
    font-size: 1rem;
    resize: vertical;
}

#createThreadModal .input-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Comments Section */
.comments-section {
    padding: 20px;
}

.comments-section h3 {
    color: var(--text-primary);
    margin: 0 0 15px 0;
    font-size: 1.2rem;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #f96d00 #111;
}

.comments-list::-webkit-scrollbar {
    width: 8px;
}

.comments-list::-webkit-scrollbar-track {
    background: #111;
}

.comments-list::-webkit-scrollbar-thumb {
    background-color: #f96d00;
    border-radius: 10px;
}

.comment-item {
    background: var(--bg-tertiary);
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.comment-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comment-text {
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.comment-upvote {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.comment-upvote:hover {
    background: var(--bg-hover);
    border-color: var(--accent-secondary);
}

.comment-upvote.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.comment-form {
    display: flex;
    gap: 10px;
}

.comment-form input {
    flex: 1;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.comment-form input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.comment-form button {
    padding: 12px 24px;
}

/* Forum Modal Adjustments */
.forum-modal {
    width: min(680px, 90vw);
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    background: rgba(15, 15, 15, 0.95);
    border: 1px solid #333;
}

.forum-modal .modal-header {
    padding-right: 70px;
}

.forum-modal .close-settings {
    top: 24px;
    right: 24px;
    transform: none;
    z-index: 2;
}

.forum-modal .modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(1000px - 120px);
}

#threadDetailModal {
    position: static;
    inset: auto;
    width: 100%;
    height: auto;
    display: none;
    align-items: stretch;
    justify-content: stretch;
    background: transparent;
}

#threadDetailModal.active {
    display: block;
}

#threadDetailModal .settings-content {
    width: 100%;
    max-width: none;
    height: auto;
    max-height: none;
}

#threadsContainer.show-detail .thread-card,
#threadsContainer.show-detail .empty-state {
    display: none;
}

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

    .forum-sidebar {
        width: 100%;
        position: static;
        margin-bottom: 20px;
    }

    .movies-list {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .forum-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .create-thread-btn {
        width: 100%;
    }

    .thread-card {
        flex-direction: column;
    }

    .thread-votes-column {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
    }

    .thread-header {
        flex-direction: column;
    }

    .thread-thumbnail {
        width: 100%;
        height: 200px;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg,
.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin: 0 0 10px 0;
}

.empty-state p {
    color: var(--text-muted);
}

/* Forum Search Dropdown Styles */
.search-wrapper-forum {
    position: relative;
}

.search-results-dropdown {
    position: static;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 8px;
    max-height: 600px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
}

.search-results-dropdown.active {
    display: block;
}

.search-item-forum {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-item-forum:last-child {
    border-bottom: none;
}

.search-item-forum:hover {
    background: var(--bg-hover);
}

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

.search-loading {
    padding: 15px;
    text-align: center;
    color: var(--text-muted);
}

/* =========================================
   FORUM PAGE -- aligned to the site's actual look: flat accent buttons,
   small border radii, var()-based cards/shadows, no glass/gradient/pill
   dashboard styling that doesn't appear anywhere else on the site.
   ========================================= */
.forum-page {
    background: var(--bg-primary);
}

/* FORUM DISABLED, DEACTIVATED FEATURE -- locked/under-development placeholder
   shown instead of the (now backend-disabled) forum content. */
.forum-locked-state {
    min-height: calc(100vh - 80px);
    margin-top: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.forum-locked-card {
    width: min(480px, 100%);
    text-align: center;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 40px 32px;
}

.forum-locked-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: rgba(255, 107, 0, 0.12);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.forum-locked-icon svg {
    width: 28px;
    height: 28px;
}

.forum-locked-kicker {
    margin: 0 0 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.forum-locked-card h1 {
    margin: 0 0 10px;
    font-size: 1.6rem;
    color: var(--text-primary);
}

.forum-locked-desc {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.forum-page .forum-container {
    margin: 82px auto 0;
    width: min(100%, 1480px);
}

.forum-page .sidebar-kicker {
    display: inline-block;
    width: fit-content;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-primary);
}

.forum-page .sidebar-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.forum-page .forum-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.forum-page .forum-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 22px;
    padding: 25px;
    border-radius: 12px;
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
}

.forum-page .forum-hero-kicker {
    margin: 0 0 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.forum-page .forum-hero h1 {
    margin: 0;
    font-size: clamp(1.7rem, 2.6vw, 2.4rem);
    line-height: 1.1;
    color: var(--text-primary);
}

.forum-page .forum-hero-copy > p {
    margin: 10px 0 0;
    max-width: 640px;
    color: var(--text-secondary);
}

.forum-page .forum-stats-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.forum-page .forum-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 600;
}

.forum-page .forum-stat-chip span {
    color: var(--accent-primary);
    font-weight: 800;
}

.forum-page .forum-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.forum-page .forum-hero-btn {
    border: none;
    background: var(--accent-primary);
    color: #fff;
    border-radius: 6px;
    padding: 11px 16px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.forum-page .forum-hero-btn:hover {
    background: var(--accent-hover);
}

.forum-page .forum-hero-btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.forum-page .forum-hero-btn-secondary:hover {
    background: var(--bg-hover);
}

@media (max-width: 1100px) {
    .forum-page .forum-container {
        flex-direction: column;
        padding: 18px;
    }

    .forum-page .forum-sidebar {
        width: 100%;
        min-width: 0;
        position: static;
    }
}

@media (max-width: 768px) {
    .forum-page .forum-hero {
        padding: 18px;
        align-items: flex-start;
        flex-direction: column;
    }

    .forum-page .forum-hero-actions {
        width: 100%;
    }

    .forum-page .forum-hero-btn {
        width: 100%;
    }
}

