/**
 * Forum Theme CSS — Consolidated Design System
 * Replaces inline <style> blocks in forum/index.php, category.php, thread.php
 * Uses CSS variables with hard-coded fallbacks for reliability
 */

/* ────────────────────────────────────────────────────────────────
   CSS VARIABLE DEFINITIONS (missing from other stylesheets)
   ──────────────────────────────────────────────────────────────── */
:root {
    --purple-primary: #8b5cf6;
    --purple-dark: #1a0f3c;
    --pink-500: #ec4899;
    --transition-smooth: 0.2s ease;
}

/* ────────────────────────────────────────────────────────────────
   FORUM HERO (index.php)
   ──────────────────────────────────────────────────────────────── */
.forum-hero {
    background: linear-gradient(135deg, #1a0f3c 0%, #2d1b69 50%, #1a0f3c 100%);
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 18px;
    padding: 44px 40px;
    margin: 20px 0 28px;
    position: relative;
    overflow: hidden;
}
.forum-hero::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.forum-hero::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 70%);
    border-radius: 50%;
}
.forum-hero-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.forum-hero-text h1 {
    color: white;
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 8px;
}
.forum-hero-text h1 i {
    color: #a78bfa;
    margin-right: 10px;
}
.forum-hero-text p {
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
    margin: 0;
}
.forum-hero-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.forum-hero-stat {
    text-align: center;
}
.forum-hero-stat-val {
    font-size: 1.8rem;
    font-weight: 800;
    color: #a78bfa;
    line-height: 1;
}
.forum-hero-stat-lbl {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

@media (max-width: 600px) {
    .forum-hero { padding: 28px 20px; border-radius: 12px; }
    .forum-hero-text h1 { font-size: 1.6rem; }
    .forum-hero-inner { flex-direction: column; gap: 16px; }
    .forum-hero-stats { gap: 14px; }
    .forum-hero-stat-val { font-size: 1.4rem; }
}

/* ────────────────────────────────────────────────────────────────
   FORUM TABS (index.php)
   ──────────────────────────────────────────────────────────────── */
.forum-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid rgba(139,92,246,.2);
    margin: 1.5rem 0 1.25rem;
}
.forum-tab-btn {
    background: none;
    border: none;
    color: #9ca3af;
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: .9rem;
    transition: all .2s;
    border-radius: 8px 8px 0 0;
}
.forum-tab-btn:hover {
    color: #a78bfa;
    background: rgba(139,92,246,.05);
}
.forum-tab-btn.active {
    color: #a78bfa;
    border-bottom-color: #8b5cf6;
    background: rgba(139,92,246,.1);
}
.forum-tab-pane { display: none; }
.forum-tab-pane.active { display: block; }

/* ────────────────────────────────────────────────────────────────
   CATEGORY CARDS (index.php)
   ──────────────────────────────────────────────────────────────── */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.category-card {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid rgba(139,92,246,.2);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: border-color .2s, transform .1s;
    cursor: pointer;
    text-decoration: none;
}
.category-card:hover {
    border-color: rgba(139,92,246,.5);
    transform: translateY(-1px);
}
.category-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.category-info {
    flex: 1;
    min-width: 0;
}
.category-info h3 {
    color: #f1f0f5;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 4px 0;
}
.category-info p {
    color: #9ca3af;
    font-size: .8rem;
    margin: 0;
}
.category-meta {
    display: flex;
    gap: 16px;
    text-align: center;
    flex-shrink: 0;
}
.category-meta-item {
    font-size: .75rem;
    color: #9ca3af;
}
.category-meta-item strong {
    display: block;
    font-size: 1.1rem;
    color: #a78bfa;
    font-weight: 800;
}

/* ────────────────────────────────────────────────────────────────
   THREAD LIST (index.php, category.php)
   ──────────────────────────────────────────────────────────────── */
.thread-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.thread-row {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid rgba(139,92,246,.15);
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    transition: border-color .2s;
}
.thread-row:hover {
    border-color: rgba(139,92,246,.4);
}
.thread-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.thread-body {
    flex: 1;
    min-width: 0;
}
.thread-title {
    color: #f1f0f5;
    font-weight: 700;
    font-size: .95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.thread-meta {
    font-size: .75rem;
    color: #6b7280;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.thread-cat {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 600;
}
.thread-badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: .7rem;
    font-weight: 600;
}
.badge-pinned {
    background: rgba(245,158,11,.15);
    color: #f59e0b;
}
.badge-locked {
    background: rgba(239,68,68,.15);
    color: #ef4444;
}
.thread-stats {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    text-align: right;
}
.thread-stat {
    font-size: .75rem;
    color: #9ca3af;
}
.thread-stat strong {
    display: block;
    color: #f1f0f5;
    font-size: .95rem;
}

/* ────────────────────────────────────────────────────────────────
   CATEGORY HEADER (category.php)
   ──────────────────────────────────────────────────────────────── */
.cat-header {
    background: linear-gradient(135deg, #1a0f3c 0%, #2d1b69 50%, #1a0f3c 100%);
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 18px;
    padding: 36px 40px;
    margin: 20px 0 28px;
    position: relative;
    overflow: hidden;
}
.cat-header::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.cat-header-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
}
.cat-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}
.cat-info h1 {
    color: white;
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 6px;
}
.cat-info p {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    margin: 0;
}
.cat-stats {
    display: flex;
    gap: 20px;
    margin-top: 12px;
}
.cat-stat {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}
.cat-stat strong {
    color: #a78bfa;
    font-weight: 700;
}

@media (max-width: 600px) {
    .cat-header { padding: 24px 20px; border-radius: 12px; }
    .cat-header-inner { flex-direction: column; text-align: center; }
    .cat-info h1 { font-size: 1.4rem; }
}

/* Larger avatar in category page thread list */
.category-page .thread-avatar img,
.cat-header + .thread-list .thread-avatar img {
    width: 40px;
    height: 40px;
}
.category-page .thread-title,
.cat-header + .thread-list .thread-title {
    font-size: 1rem;
}
.category-page .thread-row,
.cat-header + .thread-list .thread-row {
    padding: 16px 18px;
}
.category-page .thread-stats,
.cat-header + .thread-list .thread-stats {
    gap: 14px;
}
.category-page .thread-stat strong,
.cat-header + .thread-list .thread-stat strong {
    font-size: 1rem;
}

/* ────────────────────────────────────────────────────────────────
   NEW THREAD BUTTON (index.php, category.php)
   ──────────────────────────────────────────────────────────────── */
.new-thread-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .2s;
}
.new-thread-btn:hover {
    opacity: .85;
    color: #fff;
}

/* ────────────────────────────────────────────────────────────────
   MODAL (index.php, category.php)
   ──────────────────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: #1a1a2e;
    border: 1px solid rgba(139,92,246,.3);
    border-radius: 16px;
    padding: 28px;
    max-width: 560px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}
.modal-box h3 {
    color: #f1f0f5;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.close-modal {
    margin-left: auto;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 1.2rem;
    cursor: pointer;
}
.form-grp {
    margin-bottom: 16px;
}
.form-grp label {
    display: block;
    margin-bottom: 6px;
    color: #9ca3af;
    font-size: .85rem;
    font-weight: 500;
}
.form-grp input,
.form-grp select,
.form-grp textarea {
    width: 100%;
    background: rgba(0,0,0,.3);
    border: 1px solid rgba(139,92,246,.2);
    border-radius: 8px;
    padding: 10px 12px;
    color: #f1f0f5;
    font-size: .9rem;
    box-sizing: border-box;
}
.form-grp textarea {
    min-height: 120px;
    resize: vertical;
}
.form-grp input:focus,
.form-grp select:focus,
.form-grp textarea:focus {
    outline: none;
    border-color: #8b5cf6;
}

/* ────────────────────────────────────────────────────────────────
   ALERT BOXES (all forum pages)
   ──────────────────────────────────────────────────────────────── */
.alert-box {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: .9rem;
}
.alert-success {
    background: rgba(16,185,129,.1);
    border: 1px solid rgba(16,185,129,.3);
    color: #10b981;
}
.alert-danger {
    background: rgba(239,68,68,.1);
    border: 1px solid rgba(239,68,68,.3);
    color: #ef4444;
}

/* ────────────────────────────────────────────────────────────────
   FORUM CONTAINER — narrower for thread page readability
   ──────────────────────────────────────────────────────────────── */
.thread-header .container,
.thread-header + .container,
.reply-box ~ .container {
    max-width: 900px;
}

/* ────────────────────────────────────────────────────────────────
   THREAD PAGE (thread.php)
   ──────────────────────────────────────────────────────────────── */
.thread-header {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 2rem 0 1.5rem;
    border-bottom: 1px solid rgba(139,92,246,.2);
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    font-size: .8rem;
    margin-bottom: 12px;
}
.breadcrumb a {
    color: #a78bfa;
    text-decoration: none;
}
.breadcrumb a:hover {
    text-decoration: underline;
}
/* thread-title is shared — the h1 on thread page needs bigger size */
.thread-header .thread-title,
.thread-header h1.thread-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f1f0f5;
    margin: 0 0 8px;
    line-height: 1.3;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}
.thread-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: .7rem;
    font-weight: 600;
}
.badge-category {
    background: rgba(139,92,246,.2);
    color: #a78bfa;
}

/* ────────────────────────────────────────────────────────────────
   POST CARDS (thread.php)
   ──────────────────────────────────────────────────────────────── */
.post-card {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid rgba(139,92,246,.15);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 14px;
    display: flex;
    gap: 16px;
}
.post-card.op-card {
    border-color: rgba(139,92,246,.35);
}
.post-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(139,92,246,.4);
    flex-shrink: 0;
}
.post-meta {
    font-size: .8rem;
    color: #6b7280;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.post-meta strong {
    color: #a78bfa;
}
.post-body {
    color: #d1d5db;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}
.post-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.btn-sm {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.btn-danger {
    background: rgba(239,68,68,.15);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,.3);
}
.btn-danger:hover {
    background: rgba(239,68,68,.25);
}
.btn-primary {
    background: rgba(139,92,246,.2);
    color: #a78bfa;
    border: 1px solid rgba(139,92,246,.3);
}
.btn-primary:hover {
    background: rgba(139,92,246,.3);
}
.btn-warning {
    background: rgba(245,158,11,.15);
    color: #f59e0b;
    border: 1px solid rgba(245,158,11,.3);
}

/* ────────────────────────────────────────────────────────────────
   ADMIN BAR (thread.php)
   ──────────────────────────────────────────────────────────────── */
.admin-bar {
    background: rgba(139,92,246,.08);
    border: 1px solid rgba(139,92,246,.2);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.admin-bar span {
    color: #9ca3af;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ────────────────────────────────────────────────────────────────
   REPLY BOX (thread.php)
   ──────────────────────────────────────────────────────────────── */
.reply-box {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid rgba(139,92,246,.2);
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
}
.reply-box h3 {
    color: #f1f0f5;
    margin: 0 0 16px;
    font-size: 1rem;
}
.reply-box textarea {
    width: 100%;
    background: rgba(0,0,0,.3);
    border: 1px solid rgba(139,92,246,.2);
    border-radius: 8px;
    padding: 12px;
    color: #f1f0f5;
    font-size: .9rem;
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
    font-family: inherit;
}
.reply-box textarea:focus {
    outline: none;
    border-color: #8b5cf6;
}
.submit-reply {
    margin-top: 10px;
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
}
.submit-reply:hover {
    opacity: .85;
}

/* ────────────────────────────────────────────────────────────────
   PAGINATION (for future use / category pages)
   ──────────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}
.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    background: #1a1a2e;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid rgba(139,92,246,.2);
}
.pagination a:hover,
.pagination span.active {
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    border-color: #8b5cf6;
}
.pagination span.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ────────────────────────────────────────────────────────────────
   RESPONSIVE — FORUM-SPECIFIC
   ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .thread-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .thread-stats {
        width: 100%;
        justify-content: space-around;
        padding-top: 10px;
        border-top: 1px solid rgba(139,92,246,.1);
        text-align: center;
    }
    .post-card {
        flex-direction: column;
        gap: 10px;
    }
    .admin-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .forum-hero { padding: 20px 16px; border-radius: 12px; }
    .forum-hero-text h1 { font-size: 1.4rem; }
    .category-card { padding: 14px 16px; gap: 12px; flex-wrap: wrap; }
    .category-meta { width: 100%; justify-content: space-around; }
    .thread-row { padding: 12px 14px; }
    .cat-header { padding: 20px 16px; }
}
