/* ============================================
   ZION OFFSEC — FORUM STYLES
   Matches: index.php, category.php, thread.php,
            new_thread.php, reply.php
   ============================================ */

/* === VARIABLES (mapped to main style.css) === */
: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-primary: #c8c8d0;
    --text-secondary: #999;
    --text-muted: #666680;
    --border: rgba(255,255,255,0.06);
    --border-color: 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;
}

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

/* === FORUM HEADER (index.php) === */
.forum-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    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-header h1 {
    font-family: var(--font-mono);
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.forum-header h1 i {
    color: var(--green);
    margin-right: 10px;
}

.forum-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 20px;
}

/* === STATS BAR === */
.forum-stats-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.forum-stats-bar span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

.forum-stats-bar span i {
    color: var(--green);
    margin-right: 6px;
}

/* === FORUM SECTIONS (index.php) === */
.forum-section {
    margin-bottom: 35px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.forum-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--green);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.forum-section-badge {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.forum-section-badge.public {
    background: var(--green-glow);
    color: var(--green);
    border: 1px solid var(--green-dim);
}

.forum-section-badge.private {
    background: rgba(0, 229, 255, 0.1);
    color: var(--cyan);
    border: 1px solid rgba(0, 229, 255, 0.3);
}

.forum-section-badge.locked {
    background: var(--red-glow);
    color: var(--red);
    border: 1px solid rgba(255, 0, 64, 0.3);
}

.forum-section-desc {
    padding: 10px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

/* === CATEGORY ROW (index.php) === */
.forum-category-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    transition: background var(--transition);
}

.forum-category-row:last-child {
    border-bottom: none;
}

.forum-category-row:hover {
    background: var(--bg-tertiary);
}

.forum-cat-icon {
    font-size: 1.8rem;
    width: 50px;
    text-align: center;
    flex-shrink: 0;
}

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

.forum-cat-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.forum-cat-info p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forum-cat-stats {
    display: flex;
    gap: 20px;
    text-align: center;
    flex-shrink: 0;
}

.forum-cat-stats div strong {
    display: block;
    font-size: 1.1rem;
    color: var(--green);
    font-family: var(--font-mono);
}

.forum-cat-stats div small {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.forum-cat-latest {
    width: 180px;
    flex-shrink: 0;
    text-align: right;
}

.latest-title {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.latest-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.latest-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.latest-empty {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* === FORUM EMPTY STATE === */
.forum-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.forum-empty-threads {
    padding: 50px 20px;
    text-align: center;
    color: var(--text-muted);
}

.forum-empty-threads i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
    opacity: 0.4;
}

/* === LOGIN PROMPT (index.php) === */
.forum-login-prompt {
    padding: 40px 20px;
    text-align: center;
}

.forum-login-prompt i.fa-user-secret {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    display: block;
}

.forum-login-prompt p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.forum-login-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* === CATEGORY HEADER (category.php) === */
.forum-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 25px;
    padding: 25px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.forum-category-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--green), transparent);
}

.forum-category-header h1 {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.forum-category-header h1 i {
    color: var(--green);
}

.forum-category-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    width: 100%;
}

/* === BREADCRUMB === */
.forum-breadcrumb {
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.forum-breadcrumb a {
    color: var(--green-dim);
    text-decoration: none;
    transition: color var(--transition);
}

.forum-breadcrumb a:hover {
    color: var(--green);
}

.forum-breadcrumb .sep {
    margin: 0 8px;
    color: var(--text-muted);
}

/* === THREAD LIST (category.php) === */
.forum-thread-list {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* === THREAD ROW (category.php) === */
.forum-thread-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    transition: background var(--transition);
}

.forum-thread-row:last-child {
    border-bottom: none;
}

.forum-thread-row:hover {
    background: var(--bg-tertiary);
}

.forum-thread-row.pinned {
    background: rgba(0, 255, 65, 0.03);
    border-left: 3px solid var(--green);
}

.forum-thread-row.locked {
    opacity: 0.7;
}

.thread-icon {
    font-size: 1.2rem;
    width: 35px;
    text-align: center;
    flex-shrink: 0;
    color: var(--text-muted);
}

.forum-thread-row.pinned .thread-icon {
    color: var(--green);
}

.forum-thread-row.locked .thread-icon {
    color: var(--red);
}

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

.thread-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.thread-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.thread-badge.pinned {
    background: var(--green-glow);
    color: var(--green);
}

.thread-badge.locked {
    background: var(--red-glow);
    color: var(--red);
}

.locked-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--red-glow);
    color: var(--red);
}

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

.thread-meta a {
    color: var(--green-dim);
    text-decoration: none;
}

.thread-stats {
    display: flex;
    gap: 18px;
    text-align: center;
    flex-shrink: 0;
}

.thread-stats div {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.thread-stats div strong {
    font-size: 1rem;
    color: var(--green);
    font-family: var(--font-mono);
}

.thread-stats div small {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.thread-latest {
    width: 160px;
    flex-shrink: 0;
    text-align: right;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.thread-latest a {
    color: var(--green-dim);
    text-decoration: none;
}

/* === THREAD HEADER (thread.php) === */
.thread-header {
    margin-bottom: 25px;
    padding: 25px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.thread-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--green), transparent);
}

.thread-header h1 {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.thread-header-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.thread-header-meta a {
    color: var(--green-dim);
    text-decoration: none;
}

.thread-header-meta i {
    margin-right: 4px;
}

/* === FORUM POSTS (thread.php) === */
.forum-post {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.forum-post.op-post {
    border-color: var(--border-green);
}

.forum-post.op-reply {
    border-left: 3px solid var(--green-dim);
}

/* Post Sidebar */
.post-sidebar {
    width: 180px;
    flex-shrink: 0;
    padding: 20px 15px;
    background: var(--bg-tertiary);
    text-align: center;
    border-right: 1px solid var(--border-color);
}

.post-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--green);
    background: var(--bg-primary);
    border: 2px solid var(--border-green);
}

.post-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.post-author {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.post-role {
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.post-role.role-admin {
    background: var(--red-glow);
    color: var(--red);
}

.post-role.role-operator {
    background: var(--green-glow);
    color: var(--green);
}

.post-role.role-member {
    background: rgba(255, 204, 0, 0.1);
    color: var(--yellow);
}

.post-author-stats {
    margin-top: 8px;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.post-author-stats small {
    display: block;
}

.post-author-stats i {
    width: 14px;
    text-align: center;
    margin-right: 3px;
    color: var(--text-muted);
}

/* Post Content */
.post-content {
    flex: 1;
    padding: 20px;
    min-width: 0;
}

.post-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.post-body {
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 0.92rem;
    word-wrap: break-word;
}

.post-body code {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--green);
}

.post-body blockquote {
    border-left: 3px solid var(--green-dim);
    padding: 10px 15px;
    margin: 15px 0;
    background: var(--bg-tertiary);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-secondary);
}

.edited-tag {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 10px;
}

/* Post Actions */
.post-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.post-action-btn {
    font-size: 0.78rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: all var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.post-action-btn:hover {
    color: var(--green);
    background: var(--green-glow);
}

.post-action-btn.danger:hover {
    color: var(--red);
    background: var(--red-glow);
}

/* === ADMIN ACTIONS (thread.php) === */
.admin-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.admin-actions .btn-sm {
    font-size: 0.75rem;
    padding: 4px 12px;
}

/* === FORUM NOTICE === */
.forum-notice {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-top: 20px;
}

.forum-notice.locked-notice {
    border-color: rgba(255, 0, 64, 0.3);
    color: var(--red);
}

.forum-notice i {
    margin-right: 8px;
}

.forum-notice a {
    color: var(--green);
    text-decoration: none;
}

.forum-notice a:hover {
    text-decoration: underline;
}

/* === REPLY FORM (thread.php) === */
.forum-reply-form {
    margin-top: 25px;
    padding: 25px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.forum-reply-form h3 {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--green);
    margin-bottom: 15px;
}

.forum-reply-form h3 i {
    margin-right: 8px;
}

.forum-reply-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 15px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color var(--transition);
    box-sizing: border-box;
}

.forum-reply-form textarea:focus {
    outline: none;
    border-color: var(--green-dim);
    box-shadow: 0 0 0 2px var(--green-glow);
}

/* === NEW THREAD FORM (new_thread.php) === */
.forum-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.forum-form-container h1 {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    color: var(--green);
    margin-bottom: 25px;
    text-align: center;
}

.forum-new-thread-form .form-group {
    margin-bottom: 20px;
}

.forum-new-thread-form label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.forum-new-thread-form input[type="text"],
.forum-new-thread-form textarea,
.forum-new-thread-form select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: border-color var(--transition);
    box-sizing: border-box;
}

.forum-new-thread-form input[type="text"]:focus,
.forum-new-thread-form textarea:focus,
.forum-new-thread-form select:focus {
    outline: none;
    border-color: var(--green-dim);
    box-shadow: 0 0 0 2px var(--green-glow);
}

.forum-new-thread-form textarea {
    min-height: 200px;
    resize: vertical;
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
}

/* === FORUM ALERT === */
.forum-alert {
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.88rem;
}

.forum-alert.error {
    background: var(--red-glow);
    color: var(--red);
    border: 1px solid rgba(255, 0, 64, 0.3);
}

.forum-alert.success {
    background: var(--green-glow);
    color: var(--green);
    border: 1px solid var(--border-green);
}

/* === PAGINATION (category.php, thread.php) === */
.forum-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.forum-pagination a,
.forum-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all var(--transition);
}

.forum-pagination a {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.forum-pagination a:hover {
    background: var(--green-glow);
    color: var(--green);
    border-color: var(--green-dim);
}

.forum-pagination span.active {
    background: var(--green);
    color: var(--bg-primary);
    font-weight: 700;
    border: 1px solid var(--green);
}

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

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--green);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: var(--green-dim);
    box-shadow: 0 0 20px var(--green-glow);
}

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

.btn-secondary:hover {
    border-color: var(--green-dim);
    color: var(--green);
}

.btn-danger {
    background: var(--red-glow);
    color: var(--red);
    border: 1px solid rgba(255, 0, 64, 0.3);
}

.btn-danger:hover {
    background: rgba(255, 0, 64, 0.25);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.78rem;
}

/* === ACCENT === */
.accent {
    color: var(--green);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .forum-container {
        padding: 15px 10px 40px;
    }

    .forum-header {
        padding: 25px 15px;
    }

    .forum-header h1 {
        font-size: 1.4rem;
    }

    .forum-stats-bar {
        gap: 15px;
    }

    .forum-category-row {
        flex-wrap: wrap;
        padding: 12px 15px;
    }

    .forum-cat-stats {
        display: none;
    }

    .forum-cat-latest {
        display: none;
    }

    .forum-thread-row {
        flex-wrap: wrap;
    }

    .thread-stats {
        display: none;
    }

    .thread-latest {
        display: none;
    }

    .forum-category-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Posts responsive */
    .forum-post {
        flex-direction: column;
    }

    .post-sidebar {
        width: 100%;
        flex-direction: row;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 15px;
        text-align: left;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .post-avatar {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        margin: 0;
    }

    .post-author-stats {
        display: none;
    }

    .post-content {
        padding: 15px;
    }

    .forum-form-container {
        padding: 20px 15px;
    }

    .form-actions {
        flex-direction: column;
    }

    .forum-reply-form {
        padding: 15px;
    }

    .thread-header h1 {
        font-size: 1.1rem;
    }

    .thread-header-meta {
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .forum-header h1 {
        font-size: 1.2rem;
    }

    .forum-section-title {
        font-size: 0.95rem;
        flex-wrap: wrap;
    }

    .forum-login-buttons {
        flex-direction: column;
        align-items: center;
    }

    .post-sidebar {
        flex-wrap: wrap;
    }
}
