/* ============================================
   ZION OFFSEC — FORUM STYLES
   Aligned with pages/forum.php class names
   ============================================ */

/* === VARIABLES === */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a2e;
    --bg-card: #0f0f18;
    --bg-hover: #1e1e30;
    --green: #00ff41;
    --green-dark: #00cc33;
    --green-dim: #00cc33;
    --green-glow: rgba(0, 255, 65, 0.15);
    --red: #ff0040;
    --red-glow: rgba(255, 0, 64, 0.15);
    --yellow: #f0c030;
    --cyan: #00e5ff;
    --orange: #ff6b35;
    --purple: #bf5af2;
    --text: #c8c8d0;
    --text-bright: #ffffff;
    --text-dim: #666680;
    --text-muted: #666680;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(0,255,65,0.15);
    --border-green: rgba(0, 255, 65, 0.2);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: 0.3s ease;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    --font-display: 'Orbitron', sans-serif;
}

/* === UTILITY === */
.hidden { display: none !important; }

/* === FORUM CONTAINER === */
.forum-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

/* === FORUM HEADER === */
.forum-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}
.forum-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--green), transparent);
}
.forum-title {
    font-family: var(--font-mono);
    font-size: 2rem;
    color: var(--text-bright);
    margin-bottom: 10px;
}
.forum-title .accent { color: var(--green); }
.forum-title i { color: var(--green); margin-right: 10px; }
.forum-subtitle {
    color: var(--text-dim);
    font-size: 1rem;
    margin-bottom: 15px;
}

/* === ALERT MESSAGES === */
.forum-alert {
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
    border: 1px solid;
}
.forum-alert-success {
    background: rgba(0,255,65,0.08);
    border-color: var(--green-dim);
    color: var(--green);
}
.forum-alert-error {
    background: var(--red-glow);
    border-color: var(--red);
    color: var(--red);
}

/* === BREADCRUMB === */
.forum-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--text-dim);
    flex-wrap: wrap;
}
.forum-breadcrumb a {
    color: var(--green);
    text-decoration: none;
    transition: var(--transition);
}
.forum-breadcrumb a:hover { color: var(--text-bright); }
.bc-sep { color: var(--text-dim); opacity: 0.5; }

/* ═══════════════════════════════════════
   CATEGORIES VIEW (main forum page)
   ═══════════════════════════════════════ */

.forum-categories-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.forum-category-row {
    display: grid;
    grid-template-columns: 50px 1fr 140px 200px;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    background: var(--bg-card);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}
.forum-category-row:last-child { border-bottom: none; }
.forum-category-row:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

/* fc- = forum category */
.fc-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--green-glow);
    border-radius: var(--radius);
    color: var(--green);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.fc-info { min-width: 0; }
.fc-name {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-bright);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fc-desc {
    font-size: 0.82rem;
    color: var(--text-dim);
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fc-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
}
.fc-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.fc-stat-val {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--green);
}
.fc-stat-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fc-latest {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: right;
    min-width: 0;
}
.fc-latest-title {
    font-size: 0.82rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fc-latest-user {
    font-size: 0.72rem;
    color: var(--text-dim);
}
.fc-latest-empty {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-style: italic;
}

/* ═══════════════════════════════════════
   RECENT ACTIVITY + THREAD LISTS
   ═══════════════════════════════════════ */

.forum-recent {
    margin-top: 40px;
}

.forum-section-title {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--text-bright);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.forum-section-title i {
    color: var(--green);
    margin-right: 8px;
}

.forum-threads-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.forum-thread-row {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-card);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}
.forum-thread-row:last-child { border-bottom: none; }
.forum-thread-row:hover {
    background: var(--bg-hover);
}
.forum-thread-row.pinned {
    border-left: 3px solid var(--yellow);
    background: rgba(240, 192, 48, 0.03);
}
.forum-thread-row.locked {
    opacity: 0.7;
}

/* ft- = forum thread */
.ft-pin {
    color: var(--yellow);
    font-size: 0.85rem;
    text-align: center;
    width: 30px;
    flex-shrink: 0;
}

.ft-info { min-width: 0; }
.ft-title {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-bright);
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ft-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.78rem;
    flex-wrap: wrap;
}
.ft-cat {
    font-weight: 500;
}
.ft-cat i { margin-right: 4px; }
.ft-author { color: var(--text-dim); }
.ft-date { color: var(--text-dim); }
.ft-last-reply {
    color: var(--text-dim);
    font-size: 0.75rem;
}

.ft-stats {
    display: flex;
    gap: 14px;
    font-size: 0.82rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
    white-space: nowrap;
}
.ft-stats i {
    margin-right: 4px;
    color: var(--green-dim);
}

/* ═══════════════════════════════════════
   CATEGORY VIEW (thread list in category)
   ═══════════════════════════════════════ */

/* New Thread Form (toggled) */
.forum-compose {
    background: var(--bg-secondary);
    border: 1px solid var(--border-green);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}
.forum-compose .form-group {
    margin-bottom: 16px;
}
.forum-compose .form-control {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-bright);
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: var(--transition);
    box-sizing: border-box;
}
.forum-compose .form-control:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 2px var(--green-glow);
}
.forum-compose textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Empty state */
.forum-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}
.forum-empty i {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    opacity: 0.4;
}
.forum-empty p {
    font-size: 1rem;
    margin-bottom: 20px;
}

/* ═══════════════════════════════════════
   THREAD DETAIL VIEW
   ═══════════════════════════════════════ */

.forum-thread-detail {
    margin-bottom: 30px;
}
.forum-thread-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--text-bright);
    margin: 0 0 12px 0;
    line-height: 1.3;
}
.forum-thread-title i {
    color: var(--yellow);
    font-size: 0.9rem;
    margin-right: 8px;
}
.forum-thread-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-dim);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.forum-thread-meta i {
    color: var(--green-dim);
    margin-right: 4px;
}

/* === REPLIES === */
.forum-replies {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 24px;
}

.forum-reply {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
    transition: var(--transition);
}
.forum-reply:hover {
    border-color: var(--border-hover);
}
.forum-reply:first-child {
    border-color: var(--border-green);
    background: rgba(0,255,65,0.02);
}

/* fr- = forum reply */
.fr-sidebar {
    background: var(--bg-secondary);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border-right: 1px solid var(--border);
}
.fr-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--green-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
    font-size: 1.2rem;
    border: 2px solid var(--border-green);
}
.fr-username {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--green);
    text-align: center;
    word-break: break-all;
}
.fr-date {
    font-size: 0.72rem;
    color: var(--text-dim);
    text-align: center;
}

.fr-body {
    padding: 18px 20px;
    color: var(--text);
    line-height: 1.7;
    font-size: 0.92rem;
}
.fr-body p { margin: 0 0 12px 0; }
.fr-body p:last-child { margin-bottom: 0; }
.fr-body code {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--green);
}
.fr-body pre {
    background: var(--bg-primary);
    padding: 14px;
    border-radius: var(--radius);
    overflow-x: auto;
    border: 1px solid var(--border);
    margin: 12px 0;
}
.fr-body pre code {
    background: none;
    padding: 0;
}
.fr-body blockquote {
    border-left: 3px solid var(--green-dim);
    padding-left: 14px;
    color: var(--text-dim);
    margin: 12px 0;
    font-style: italic;
}

/* Reply form at bottom */
.forum-reply-title {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--text-bright);
    margin-bottom: 16px;
}
.forum-reply-title i {
    color: var(--green);
    margin-right: 8px;
}

/* Locked / Login notices */
.forum-locked-notice, .forum-login-notice {
    text-align: center;
    padding: 24px;
    margin-top: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: 0.95rem;
}
.forum-locked-notice i {
    color: var(--red);
    margin-right: 8px;
}

/* ═══════════════════════════════════════
   BUTTONS (forum-specific overrides)
   ═══════════════════════════════════════ */

.forum-header .btn {
    margin-top: 10px;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 768px) {
    .forum-category-row {
        grid-template-columns: 40px 1fr;
        gap: 10px;
        padding: 14px;
    }
    .fc-stats, .fc-latest {
        display: none;
    }
    .forum-thread-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px 14px;
    }
    .ft-pin { display: none; }
    .ft-stats {
        justify-content: flex-start;
    }
    .forum-reply {
        grid-template-columns: 1fr;
    }
    .fr-sidebar {
        flex-direction: row;
        padding: 10px 14px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .fr-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    .forum-thread-title {
        font-size: 1.2rem;
    }
    .forum-thread-meta {
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .forum-container {
        padding: 15px 10px 40px;
    }
    .forum-header {
        padding: 24px 14px;
    }
    .forum-title {
        font-size: 1.4rem;
    }
    .fc-icon {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}