:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-accent: #1e2a47;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-dim: #6c757d;
    --text-highlight: #ffffff;
    --border-primary: #2d3748;
    --border-active: #4a5568;
    --accent-success: #4ade80;
    --accent-warning: #fbbf24;
    --accent-error: #f87171;
    --accent-info: #60a5fa;
    --accent-cyan: #22d3ee;
    --accent-purple: #a78bfa;
    --accent-orange: #fb923c;
    --accent-green: #34d399;
    --accent-blue: #3b82f6;
    --accent-pink: #f472b6;
    --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    line-height: 1.4;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.terminal {
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 0;
    box-shadow: var(--shadow-glow);
    max-width: 1200px;
    width: 100%;
    overflow: hidden;
}

.terminal-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 0;
    display: inline-block;
    transition: all 0.2s ease;
}

.control.close {
    background: var(--accent-error);
}

.control.close:hover {
    background: #dc2626;
}

.control.minimize {
    background: var(--accent-warning);
}

.control.minimize:hover {
    background: #d97706;
}

.control.maximize {
    background: var(--accent-success);
}

.control.maximize:hover {
    background: #16a34a;
}

.title-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.prompt {
    color: var(--accent-success);
    font-weight: 700;
}

.title {
    color: var(--text-primary);
    letter-spacing: 0.5px;
    font-weight: 600;
}

.cursor {
    color: var(--accent-cyan);
    animation: blink 1.2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.terminal-body {
    padding: 24px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-primary);
}

.app-title {
    color: var(--text-primary);
    font-size: 1.2em;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.status-bar {
    display: flex;
    gap: 12px;
}

.status-item {
    background: var(--bg-tertiary);
    padding: 6px 12px;
    border-radius: 0;
    font-size: 0.8em;
    color: var(--accent-success);
    border: 1px solid var(--border-primary);
    font-weight: 600;
}

/* Stats Panel */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--accent-info);
    transform: translateY(-2px);
}

.stat-label {
    color: var(--text-dim);
    font-size: 0.75em;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    color: var(--text-highlight);
    font-size: 1.4em;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

/* Forum Section */
.forum-section {
    margin-bottom: 24px;
}

.section-title {
    color: var(--text-primary);
    font-size: 1.1em;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.forum-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.terminal-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0;
    padding: 10px 20px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.terminal-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-info);
    transform: translateY(-1px);
}

.terminal-btn.primary {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.terminal-btn.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* Table Styles */
.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 0;
    overflow: hidden;
}

.forum-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.forum-table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8em;
    border-bottom: 1px solid var(--border-primary);
}

.forum-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-secondary);
}

.forum-table tr:last-child td {
    border-bottom: none;
}

.forum-table tr:hover {
    background: var(--bg-accent);
}

.forum-table tr:hover td {
    color: var(--text-highlight);
}

/* Column Widths */
.col-topic {
    width: 45%;
}

.col-category {
    width: 20%;
}

.col-replies {
    width: 10%;
}

.col-views {
    width: 10%;
}

.col-activity {
    width: 15%;
}

/* Category Tags */
.category-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 0;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-career {
    background: var(--accent-purple);
    color: white;
}

.category-feedback {
    background: var(--accent-cyan);
    color: var(--bg-primary);
}

.category-support {
    background: var(--accent-orange);
    color: white;
}

.category-javascript {
    background: var(--accent-warning);
    color: var(--bg-primary);
}

.category-html-css {
    background: var(--accent-blue);
    color: white;
}

.category-python {
    background: var(--accent-green);
    color: var(--bg-primary);
}

.category-motivation {
    background: var(--accent-pink);
    color: white;
}

.category-backend {
    background: var(--accent-info);
    color: white;
}

.category-general {
    background: var(--text-dim);
    color: white;
}

/* Topic Links */
.topic-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.topic-link:hover {
    color: var(--accent-info);
    text-decoration: underline;
}

/* Loading States */
.loading-row {
    animation: pulse 2s infinite;
}

.loading-cell {
    text-align: center;
    color: var(--text-dim);
    padding: 40px !important;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* Footer Stats */
.footer-stats {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-top: 1px solid var(--border-primary);
    font-size: 0.8em;
    color: var(--text-dim);
}

.stat {
    font-family: 'JetBrains Mono', monospace;
}

#footer-status {
    color: var(--accent-success);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .terminal-body {
        padding: 16px;
    }

    .app-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .stats-panel {
        grid-template-columns: 1fr;
    }

    .forum-controls {
        flex-direction: column;
    }

    .table-container {
        overflow-x: auto;
    }

    .forum-table {
        min-width: 700px;
    }

    .footer-stats {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-active);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}