:root {
    --bg-main: #070e17;
    --bg-card: rgba(15, 25, 38, 0.85);
    --bg-card-hover: rgba(22, 38, 58, 0.95);
    --bg-input: rgba(8, 16, 26, 0.9);
    --gold: #d4af37;
    --gold-bright: #ffd700;
    --gold-glow: rgba(212, 175, 55, 0.35);
    --text-primary: #e6edf3;
    --text-muted: #8b949e;
    --border-color: rgba(212, 175, 55, 0.2);
    --border-hover: rgba(212, 175, 55, 0.5);
    --danger: #ff4d4f;
    --success: #52c41a;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.12) 0%, transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(30, 58, 138, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
}

/* Header */
.forum-header {
    background: rgba(10, 19, 31, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.logo-img {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    box-shadow: 0 0 10px var(--gold-glow);
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #fff 0%, var(--gold-bright) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.3);
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gold-bright);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, #b89020 100%);
    color: #0b1118;
    box-shadow: 0 2px 8px var(--gold-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 100%);
    transform: translateY(-1px);
}

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

/* Breadcrumb */
.breadcrumb-bar {
    max-width: 1100px;
    width: 100%;
    margin: 1.25rem auto 0;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.breadcrumb-bar a {
    color: var(--gold);
    text-decoration: none;
}
.breadcrumb-bar a:hover {
    text-decoration: underline;
}

/* Main Container */
.forum-container {
    max-width: 1100px;
    width: 100%;
    margin: 1rem auto;
    padding: 0 1.25rem;
    flex: 1;
}

/* Views */
.forum-view {
    display: none;
}
.forum-view.active {
    display: block;
}

/* Categories List */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
}
.category-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.cat-main {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.cat-icon {
    font-size: 2.2rem;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.cat-info h3 {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}
.cat-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.cat-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 120px;
}
.cat-stat {
    font-size: 0.85rem;
    color: var(--gold-bright);
    font-weight: 600;
}
.cat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Topics View */
.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}
.view-header h2 {
    font-size: 1.4rem;
    color: var(--gold-bright);
}

.topics-table {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.topic-row {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.85rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.15s ease;
}
.topic-row:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.topic-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.topic-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}
.topic-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.topic-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.topic-stats {
    text-align: right;
}

/* Single Topic & Posts */
.topic-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.topic-header-title {
    font-size: 1.4rem;
    color: var(--gold-bright);
    margin-bottom: 0.5rem;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    overflow: hidden;
}

.post-author {
    width: 170px;
    background: rgba(0, 0, 0, 0.25);
    border-right: 1px solid var(--border-color);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.post-author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--border-color);
    object-fit: cover;
}

.post-author-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--gold-bright);
}

.post-author-stats {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-body {
    flex: 1;
    padding: 1.1rem 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.post-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.4rem;
}

.post-content {
    font-size: 0.92rem;
    line-height: 1.6;
    color: #d1d5db;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Forms */
.form-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}
.form-input, .form-textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus {
    border-color: var(--gold-bright);
}
.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active {
    display: flex;
}
.modal-box {
    background: #0f1926;
    border: 1px solid var(--gold);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.modal-title {
    font-size: 1.2rem;
    color: var(--gold-bright);
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}

/* Footer */
.forum-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(10, 19, 31, 0.8);
    margin-top: 2rem;
}

/* Mobile responsive */
@media (max-width: 650px) {
    .category-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    .cat-meta {
        text-align: left;
    }
    .post-card {
        flex-direction: column;
    }
    .post-author {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex-direction: row;
        justify-content: flex-start;
        padding: 0.6rem 1rem;
        gap: 0.8rem;
    }
    .post-author-avatar {
        width: 38px;
        height: 38px;
        font-size: 1.3rem;
    }
    .topic-right {
        display: none;
    }
}
