/* ======== GLOBAL STYLES & VARIABLES ======== */
:root {
    --primary-color: #6a11cb;
    --primary-hover: #8a3ffc;
    --secondary-color: #2575fc;
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --border-color: #333;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-accent: var(--primary-color);
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --header-height: 70px;
}

/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* ======== UTILITY CLASSES ======== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 700;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--text-primary);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background-color: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #2a2a2a;
    color: var(--text-primary);
}

.btn-lg {
    font-size: 1.1rem;
    padding: 1rem 2rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

.btn-danger {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}
.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
    color: white;
}

/* ======== HEADER & NAVIGATION ======== */
.main-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-auth {
    display: flex;
    gap: 1rem;
    align-items: center; /* Vertically align items */
}

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* ======== HERO SECTION ======== */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60vh;
    padding: 40px 20px;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://via.placeholder.com/1920x1080.png?text=Gaming+Background') no-repeat center center/cover;
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ======== CARDS (News, Admin Dashboard) ======== */
.news-grid, .admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background-color: var(--surface-color);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 1.5rem;
}

.card-tag {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}
.admin-grid .card-title i {
    margin-right: 8px;
    color: var(--text-secondary);
}


.card-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.card-link {
    font-weight: 600;
    color: var(--primary-color);
}

.admin-grid .btn-secondary {
    margin-top: 1rem;
}

.admin-tag {
    background-color: var(--text-secondary) !important;
    color: var(--bg-color) !important;
}


/* ======== COMMUNITY HUB (Index Page) ======== */
.community-hub {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.hub-column {
    flex: 1;
    min-width: 300px;
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.hub-column .section-title {
    text-align: left;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.discussion-list li, .event-list li {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.discussion-list li:last-child, .event-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.discussion-list li:first-child, .event-list li:first-child {
    padding-top: 0;
}

.discussion-list a {
    display: block;
    color: var(--text-primary);
}

.discussion-list a:hover strong {
    color: var(--primary-color);
}

.discussion-list strong {
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.post-meta strong {
    display: inline;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.event-list li {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.event-date {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    padding: 0.75rem;
    min-width: 60px;
}

.event-date .month {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
}

.event-date .day {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.event-details a {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.event-details a:hover {
    color: var(--primary-color);
}

.event-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.25rem;
}

.hub-column .btn {
    margin-top: 2rem;
}

/* ======== TRENDING VIDEOS (Homepage) ======== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.video-embed-card {
    background-color: var(--surface-color);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.video-embed-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-color: #000;
}

.video-embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-channel {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ======== FINAL CTA ======== */
.cta-section {
    background-color: var(--surface-color);
    text-align: center;
    padding: 60px 20px;
}

.cta-section .section-title {
    margin-bottom: 1rem;
}

.cta-section p {
    max-width: 600px;
    margin: 0 auto 2rem;
    font-size: 1.1rem;
}

/* ======== FOOTER ======== */
.main-footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding-top: 3rem;
    color: var(--text-secondary);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
    padding-bottom: 3rem;
}

.footer-about .footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-links h4, .footer-social h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-links ul li {
    margin-bottom: 0.5rem;
}

.footer-links ul li a {
    color: var(--text-secondary);
}

.footer-links ul li a:hover {
    color: var(--text-primary);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    color: var(--text-secondary);
    font-size: 1.5rem;
}

.social-icons a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.9rem;
}

/* ======== AUTHENTICATION FORMS ======== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--header-height));
    padding: 40px 20px;
}

.auth-form-box {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.auth-form-box h1 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.3);
}

.form-group textarea.form-control {
    line-height: 1.6;
    resize: vertical;
    min-height: 150px;
}

.form-text {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
}

.form-text a {
    color: var(--primary-color);
    font-weight: 600;
}

.form-text a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.form-check-input {
    width: 1.25em;
    height: 1.25em;
}

.form-check-label {
    margin-bottom: 0;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Auth Alerts */
.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: #2a1a1f;
    border-color: #842029;
    color: #f5c2c7;
}

.alert-success {
    background-color: #1c2b26;
    border-color: #0f5132;
    color: #badbcc;
}

.alert-info {
    background-color: #192a3e;
    border-color: #0c5460;
    color: #b8daff;
}

/* ======== FORUM PAGE STYLES ======== */
.forum-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.forum-category-header {
    background-color: var(--surface-color);
    padding: 0.75rem 1.5rem;
    border-radius: 8px 8px 0 0;
    border: 1px solid var(--border-color);
    border-bottom: 2px solid var(--primary-color);
    margin-top: 2rem;
}

.forum-category-header h2 {
    margin-bottom: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.forum-list-container {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.forum-row {
    display: grid;
    grid-template-columns: 3fr 1fr 2fr;
    gap: 1.5rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.forum-row:last-child {
    border-bottom: none;
}

.forum-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-width: 0;
}

.forum-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    opacity: 0.7;
}

.forum-details { min-width: 0; } /* Allow text to wrap/ellipsis */

.forum-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forum-title:hover {
    color: var(--primary-hover);
}

.forum-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forum-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: left;
}

.stat-item strong {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.forum-last-post {
    font-size: 0.9rem;
    min-width: 0;
}

.last-post-title {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.last-post-title:hover {
    color: var(--primary-hover);
}

.last-post-meta {
    color: var(--text-secondary);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.last-post-meta strong {
    color: var(--primary-color);
    font-weight: 600;
}

.last-post-time {
    display: block;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ======== TOPIC LIST STYLES ======== */
.topic-list-container {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 2rem;
}

.topic-row {
    display: grid;
    grid-template-columns: 3fr 1fr 2fr;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.topic-row:last-child {
    border-bottom: none;
}

.topic-row.header-row {
    background-color: var(--bg-color);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 1.5rem;
}

.topic-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-width: 0;
}

.topic-icon {
    font-size: 1.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.topic-details { min-width: 0; }

.topic-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-title:hover {
    color: var(--primary-hover);
}

.topic-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topic-meta strong {
    color: var(--primary-color);
    font-weight: 600;
}

.topic-time {
    display: inline;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}
.topic-time::before { content: "• "; }

.topic-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.topic-last-post {
    font-size: 0.9rem;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.last-post-meta a:hover {
    color: var(--text-primary);
}

/* ======== BREADCRUMBS ======== */
.breadcrumbs {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.breadcrumbs a {
    color: var(--text-secondary);
    font-weight: 500;
}
.breadcrumbs a:hover {
    color: var(--text-primary);
}
.breadcrumbs i {
    font-size: 0.7rem;
    margin: 0 0.5rem;
}

.topic-page-title {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
}


/* ======== CHAT BUBBLE STYLES (View Topic) ======== */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.bubble-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    max-width: 85%;
}

.author-avatar {
    font-size: 2.5rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.post-bubble {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    overflow: hidden;
}

.bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.author-name {
    font-weight: 700;
    font-size: 1rem;
}

.post-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.post-body {
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.post-body p { /* Ensure paragraphs inside post body inherit color */
    color: inherit;
}


/* --- "Other" Posts (Left) --- */
.bubble-row-other {
    align-self: flex-start;
}
.bubble-row-other .post-bubble {
    background-color: var(--surface-color);
}
.bubble-row-other .author-name {
    color: var(--primary-color);
}

/* --- "My" Posts (Right) --- */
.bubble-row-me {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.bubble-row-me .post-bubble {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}
.bubble-row-me .bubble-header {
    background-color: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.bubble-row-me .author-name {
    color: var(--text-primary);
}
.bubble-row-me .post-date {
    color: rgba(255, 255, 255, 0.7);
}


/* ======== REPLY FORM (View Topic) ======== */
.reply-form-container {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}


/* ======== PAGINATION STYLES ======== */
.pagination {
    margin-top: 2rem;
    text-align: center;
}

.pagination ul {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: var(--surface-color);
}

.pagination li {
    margin: 0;
}

.pagination li a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    border-right: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.pagination li:last-child a {
    border-right: none;
}

.pagination li a:hover {
    background-color: var(--bg-color);
    color: var(--text-primary);
}

.pagination li a.active {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--text-primary);
    cursor: default;
}


/* ======== ABOUT PAGE STYLES ======== */
.about-intro {
    max-width: 800px;
    margin: 0 auto 2rem auto;
    text-align: center;
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.about-intro p {
    margin-bottom: 1.5rem;
}

.icon-list {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
}

.icon-list li {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.icon-list li:last-child {
    margin-bottom: 0;
}

.icon-list li i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-top: 5px;
}

.icon-list li strong {
    display: block;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.icon-list li p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}


/* ======== ADMIN STYLES ======== */
.nav-link.admin-link {
    color: var(--primary-color);
    font-weight: 600;
}
.nav-link.admin-link:hover,
.nav-link.admin-link.active {
    color: var(--primary-hover);
}
.nav-link.admin-link i {
    margin-right: 6px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 1rem; /* Add gap for wrapped items */
}

.admin-search-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-grow: 1; /* Allow search to take space */
    min-width: 250px; /* Prevent search from getting too small */
}
.admin-search-form .form-control {
    flex-grow: 1;
    margin-bottom: 0;
}

.admin-table-container {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle; /* Align content vertically */
}

.admin-table thead th {
    background-color: var(--bg-color);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap; /* Prevent headers from wrapping */
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.admin-table .actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    white-space: nowrap; /* Prevent action buttons from wrapping */
}

.admin-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-color);
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    margin-top: 2.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.admin-category-header:first-of-type {
    margin-top: 0;
}
.admin-category-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}
.admin-category-header .actions {
    display: flex;
    gap: 0.5rem;
}

.admin-table-container.forum-table {
    border-top: none;
    border-radius: 0 0 8px 8px;
    margin-bottom: 2rem;
}

.status-verified, .status-unverified, .role-admin {
    display: inline-block;
    padding: 0.2em 0.6em;
    font-size: 0.8em;
    font-weight: 700;
    line-height: 1;
    border-radius: 0.25rem;
    vertical-align: middle;
    white-space: nowrap;
}

.status-verified {
    color: #1c2b26;
    background-color: #badbcc;
}

.status-unverified {
    color: #2a1a1f;
    background-color: #f5c2c7;
}

.role-admin {
    color: var(--text-primary);
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}

/* ======== RESPONSIVE DESIGN ======== */

/* Larger Tablets / Small Laptops */
@media (max-width: 992px) {
    .nav-menu, .nav-auth {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        flex-direction: column;
        background-color: var(--surface-color);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        padding-bottom: 1rem;
        z-index: 999; /* Ensure menu is above content */
    }
    .nav-menu {
        border-top: 1px solid var(--border-color);
    }
    .nav-menu.active, .nav-auth.active {
        left: 0;
    }
    /* Calculate nav-auth top based on number of nav items */
    .nav-auth {
        /* Example: 6 nav items * ~45px height each + padding */
        top: calc(var(--header-height) + (6 * 45px) + 2rem);
        border-top: 1px solid var(--border-color);
        padding-top: 1rem;
    }
    .nav-item {
        margin: 1rem 0; /* Reduced margin for mobile */
    }
    .nav-auth span { /* Adjust welcome message for mobile menu */
         display: block;
         margin-bottom: 1rem;
    }
    .hamburger {
        display: flex;
        z-index: 1001; /* Ensure hamburger is clickable */
    }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .hero-title { font-size: 2.5rem; }
    .community-hub { flex-direction: column; }

    .forum-row {
        grid-template-columns: 2fr 1.5fr;
        grid-template-areas:
            "info stats"
            "last-post last-post";
    }
    .forum-info { grid-area: info; }
    .forum-stats { grid-area: stats; flex-direction: column; gap: 0.5rem; }
    .forum-last-post {
        grid-area: last-post;
        border-top: 1px dashed var(--border-color);
        padding-top: 1rem;
        margin-top: 1rem;
    }
    .last-post-time { display: inline; margin-left: 0.5rem; }
    .last-post-time::before { content: "• "; }

     .topic-row {
        grid-template-columns: 2.5fr 1fr;
        grid-template-areas:
            "info stats"
            "last-post last-post";
    }
    .topic-info { grid-area: info; }
    .topic-stats { grid-area: stats; }
    .topic-last-post {
        grid-area: last-post;
        border-top: 1px dashed var(--border-color);
        padding-top: 1rem;
        margin-top: 1rem;
    }
    .topic-row.header-row {
        grid-template-columns: 2.5fr 1fr;
        grid-template-areas: "info stats";
    }
    .topic-row.header-row .topic-last-post { display: none; }
}

/* Smaller Tablets */
@media (max-width: 768px) {
    .bubble-row { max-width: 95%; }
    .author-avatar { font-size: 2rem; }

    .post-card { grid-template-columns: 1fr; }
    .post-author {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        text-align: left;
        gap: 1rem;
    }
    .author-avatar { font-size: 2.5rem; margin-bottom: 0; display: inline-block; }
    .author-meta { margin-top: 0; margin-left: 0.5rem; display: inline-block; }
    .author-meta::before { content: "•"; margin-right: 0.5rem; }

    .admin-header {
        flex-direction: column;
        align-items: stretch; /* Stretch items full width */
    }
     .admin-search-form { width: 100%; }
     .admin-header > .btn { width: 100%; text-align: center;} /* Make Add button full width */


    .admin-table thead { display: none; }
    .admin-table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        overflow: hidden;
        background-color: var(--surface-color); /* Add background for clarity */
    }
     .admin-table tr:hover { background-color: var(--surface-color); } /* Override hover on row */

    .admin-table td {
        display: block;
        text-align: right;
        padding-left: 50%; /* Make space for label */
        position: relative;
        border-bottom: 1px dashed var(--border-color); /* Dashed separator */
    }
     .admin-table td:last-child { border-bottom: none; }
    .admin-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 1.25rem;
        width: calc(50% - 2rem); /* Calculate width for label */
        font-weight: 600;
        color: var(--text-secondary);
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .admin-table .actions { justify-content: flex-end; }
    .admin-table td[data-label="Thumbnail"] img { max-width: 60px; float: right;} /* Adjust thumbnail display */

    .admin-category-header { align-items: flex-start; }
}

/* Mobile Phones */
@media (max-width: 576px) {
    h1, .hero-title { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }

    .hero-subtitle { font-size: 1rem; }

    .forum-row, .topic-row, .topic-row.header-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "info"
            "stats"
            "last-post";
        gap: 0.75rem;
        padding: 1rem;
    }
    .forum-stats, .topic-stats {
        flex-direction: row;
        gap: 1.5rem;
        border-top: 1px dashed var(--border-color);
        padding-top: 0.75rem;
    }
    .forum-last-post, .topic-last-post {
        margin-top: 0;
        padding-top: 0.75rem;
        border-top: 1px dashed var(--border-color);
    }
     .topic-row.header-row .topic-last-post { display: block; } /* Show header on mobile */

    .forum-page-header { gap: 1rem; } /* Reduce gap */

    .pagination li a { padding: 0.5rem 0.75rem; font-size: 0.8rem; }

    .auth-form-box { padding: 1.5rem; } /* Reduce padding on small screens */
    .admin-grid { grid-template-columns: 1fr; } /* Stack admin cards */
}