/* ============================================
   THE STOCKYARD — COMMUNITY HUB
   ============================================ */

.stockyard-page {
    padding-top: var(--nav-height);
    min-height: 100vh;
}

/* Hero Banner */
.stockyard-hero {
    background: linear-gradient(135deg, rgba(228,0,43,0.12), rgba(10,10,15,1) 60%);
    border-bottom: 1px solid var(--border);
    padding: 60px 0 40px;
    text-align: center;
}

.stockyard-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.stockyard-hero p {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
}

/* Community Guidelines */
.stockyard-guidelines {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 24px;
}

.guidelines-banner {
    background: rgba(228,0,43,0.05);
    border: 1px solid rgba(228,0,43,0.15);
    border-left: 4px solid #E4002B;
    border-radius: 8px;
    padding: 16px 20px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.guidelines-banner strong { color: #E4002B; }

/* Section Tabs */
.stockyard-tabs {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
}

.stockyard-tab {
    padding: 14px 24px;
    background: none;
    border: none;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.stockyard-tab:hover { color: var(--text-primary); }
.stockyard-tab.active { color: #E4002B; border-bottom-color: #E4002B; }

/* Main Content */
.stockyard-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

/* ============================================
   SHOWCASE SECTION
   ============================================ */

.showcase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.showcase-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.showcase-filter-btn {
    padding: 6px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.showcase-filter-btn:hover { border-color: rgba(228,0,43,0.4); color: #fff; }
.showcase-filter-btn.active { background: rgba(228,0,43,0.15); border-color: #E4002B; color: #E4002B; }

.share-build-btn {
    padding: 8px 20px;
    background: var(--red, #E4002B);
    border: none;
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.share-build-btn:hover { background: #ff1a4a; transform: translateY(-1px); }

/* Showcase Grid */
.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 40px;
}

.showcase-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.25s;
}

.showcase-card:hover { border-color: var(--red); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(228,0,43,0.1); }

.showcase-card-img {
    aspect-ratio: 1;
    overflow: hidden;
}

.showcase-card-img img { width: 100%; height: 100%; object-fit: cover; }

.showcase-card-body {
    padding: 12px 14px;
}

.showcase-card-title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.showcase-card-meta {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.showcase-card-tier {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(228,0,43,0.1);
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--red-bright);
    letter-spacing: 0.5px;
}

/* Showcase Empty */
.showcase-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-family: var(--font-heading);
}

/* ============================================
   DISCUSSIONS SECTION
   ============================================ */

.discussions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.discussions-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.new-thread-btn {
    padding: 8px 20px;
    background: var(--red, #E4002B);
    border: none;
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.new-thread-btn:hover { background: #ff1a4a; transform: translateY(-1px); }

/* Thread List */
.thread-list {
    display: grid;
    gap: 10px;
}

.thread-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.thread-card:hover { border-color: rgba(228,0,43,0.4); background: rgba(255,255,255,0.02); }

.thread-card.pinned { border-left: 3px solid #E4002B; }

.thread-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

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

.thread-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.thread-pin-badge {
    font-family: var(--font-display);
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #E4002B;
    background: rgba(228,0,43,0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

.thread-category {
    display: inline-block;
    padding: 2px 8px;
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
}

.thread-category-build-help { background: rgba(0,200,80,0.1); color: #00C850; }
.thread-category-show-off { background: rgba(228,0,43,0.1); color: #E4002B; }
.thread-category-general { background: rgba(100,149,237,0.1); color: #6495ED; }
.thread-category-tips-tricks { background: rgba(255,165,0,0.1); color: #FFA500; }
.thread-category-site-feedback { background: rgba(212, 175, 55, 0.1); color: #D4AF37; }

/* Pending-approval badge for moderated content */
.thread-pending-badge {
    display: inline-block;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: #D4AF37;
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 2px 7px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

.thread-card.pending,
.reply-card.pending {
    border-left: 3px solid #D4AF37;
    background: rgba(212, 175, 55, 0.04);
}

.admin-action-btn.approve-btn {
    background: rgba(0, 200, 80, 0.15);
    color: #00C850;
    border-color: rgba(0, 200, 80, 0.3);
}
.admin-action-btn.approve-btn:hover {
    background: rgba(0, 200, 80, 0.25);
}

.thread-preview {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thread-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.thread-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.thread-meta-item svg { width: 12px; height: 12px; opacity: 0.5; }

/* Thread Detail View */
.thread-detail { display: none; }
.thread-detail.active { display: block; }

.thread-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 24px;
    cursor: pointer;
    border: none;
    background: none;
    transition: color 0.2s;
}

.thread-detail-back:hover { color: #E4002B; }

.thread-detail-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.thread-detail-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.thread-detail-author img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.thread-detail-author-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
}

.thread-detail-author-date {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.thread-detail-body {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

/* Replies */
.replies-header {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.reply-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 10px;
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.reply-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.reply-author {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
}

.reply-date {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: auto;
}

.reply-body {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.reply-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

.reply-action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    cursor: pointer;
    transition: color 0.2s;
}

.reply-action-btn:hover { color: #fff; }
.reply-action-btn.upvoted { color: #E4002B; }
.reply-action-btn svg { width: 14px; height: 14px; }

/* Reply Form */
.reply-form {
    margin-top: 20px;
    display: flex;
    gap: 12px;
}

.reply-form textarea {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    resize: vertical;
    min-height: 60px;
    outline: none;
    transition: border-color 0.2s;
}

.reply-form textarea:focus { border-color: var(--red); }

.reply-form button {
    padding: 12px 20px;
    background: var(--red);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    align-self: flex-end;
    transition: background 0.2s;
}

.reply-form button:hover { background: #ff1a4a; }

/* ============================================
   NEW THREAD / SHARE BUILD MODALS
   ============================================ */

.stockyard-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.stockyard-modal-overlay.active { display: flex; }

.stockyard-modal {
    background: var(--bg-card, #141419);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 520px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideIn 0.25s ease;
}

.stockyard-modal h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.stockyard-modal .form-group {
    margin-bottom: 16px;
}

.stockyard-modal label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.stockyard-modal input,
.stockyard-modal textarea,
.stockyard-modal select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.stockyard-modal input:focus,
.stockyard-modal textarea:focus,
.stockyard-modal select:focus { border-color: var(--red); }

.stockyard-modal textarea { resize: vertical; min-height: 100px; }

.stockyard-modal select {
    appearance: none;
    cursor: pointer;
}

.stockyard-modal select option { background: #1a1a22; }

.stockyard-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.stockyard-modal-actions button {
    padding: 10px 24px;
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-cancel-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.modal-cancel-btn:hover { border-color: #fff; color: #fff; }

.modal-submit-btn {
    background: var(--red);
    border: none;
    color: #fff;
}

.modal-submit-btn:hover { background: #ff1a4a; }

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload-area:hover { border-color: var(--red); }

.file-upload-area p {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.file-upload-area .upload-note {
    font-size: 0.7rem;
    margin-top: 4px;
}

.upload-note {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Share-build photo slots — 5 labeled positions */
.share-build-slots {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.share-build-slot {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.share-build-slot-label {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.2;
    min-height: 2.4em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-build-slot-tile {
    position: relative;
    aspect-ratio: 1;
    border: 2px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.02);
}

.share-build-slot-tile:hover {
    border-color: var(--red);
    background: rgba(191, 10, 48, 0.05);
}

.share-build-slot-tile.filled {
    border-style: solid;
    border-color: var(--red);
    background: #000;
}

.share-build-slot-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.share-build-slot-add {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 4px;
    text-align: center;
}

.share-build-slot-tile:hover .share-build-slot-add {
    color: var(--red-bright);
}

.share-build-slot-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
}

.share-build-slot-remove:hover {
    background: var(--red);
}

@media (max-width: 600px) {
    .share-build-slots {
        grid-template-columns: repeat(2, 1fr);
    }
    .share-build-slot-label {
        min-height: 2em;
    }
}

/* Admin Controls */
.admin-controls {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.admin-action-btn {
    padding: 4px 10px;
    background: rgba(228,0,43,0.1);
    border: 1px solid rgba(228,0,43,0.25);
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    color: #E4002B;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-action-btn:hover { background: #E4002B; color: #fff; }

/* Report Button */
.report-btn {
    color: var(--text-muted) !important;
    font-size: 0.7rem !important;
}

.report-btn:hover { color: #E4002B !important; }

/* Discussions Empty */
.discussions-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-family: var(--font-heading);
}

/* Responsive */
@media (max-width: 600px) {
    .stockyard-tabs { overflow-x: auto; }
    .showcase-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .thread-card { flex-direction: column; }
    .reply-form { flex-direction: column; }
    .reply-form button { align-self: stretch; }
}
