/* ==========================================
   1. CSS Reset & Root Variables
   ================================---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-charcoal: #121417;
    --bg-card: #181b20;
    --bg-card-hover: #1f232b;
    --lime-primary: #84cc16;
    --lime-glow: rgba(132, 204, 22, 0.4);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: #27272a;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-speed: 0.2s ease;
}

body {
    background-color: var(--bg-charcoal);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   2. Header & Navigation Navbar
   ================================---------- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 5%;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-charcoal);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-logo {
    height: 36px;
    width: auto;
    display: block;
}

.nav-links ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed);
}

.nav-links a:hover {
    color: var(--lime-primary);
}

/* ==========================================
   3. Buttons & Interactive Elements
   ================================---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all var(--transition-speed);
    cursor: pointer;
}

.btn-primary {
    background-color: var(--lime-primary);
    color: var(--bg-charcoal);
}

.btn-primary:hover {
    background-color: #65a30d;
    box-shadow: 0 0 15px var(--lime-glow);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--lime-primary);
    color: var(--lime-primary);
}

.btn-text {
    color: var(--lime-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap var(--transition-speed);
}

.btn-text:hover {
    gap: 0.5rem;
}

/* ==========================================
   4. Hero Section (Three-Column Layout)
   ================================---------- */
.hero {
    padding: 5rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.hero-three-col {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr; /* Left spacer, Wide center, Right sidebar */
    align-items: center;
    gap: 3rem;
}

.hero-center {
    text-align: center;
}

.hero-content h1 {
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 1.25rem;
    color: var(--text-main);
}

.hero-content p {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ==========================================
   Hero Left Sidebar (Table of Contents)
   ================================---------- */
.hero-sidebar-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-header {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.sidebar-toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-toc-list a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color var(--transition-speed), transform var(--transition-speed);
}

.sidebar-toc-list a span {
    color: var(--lime-primary);
    font-family: monospace;
    font-weight: 700;
}

.sidebar-toc-list a:hover {
    color: var(--text-main);
    transform: translateX(4px);
}

/* Optional subtitle style for the stacked header */
.hero-subtitle {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--lime-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ==========================================
   5. Hero Status Sidebar (Right Column)
   ================================---------- */
.hero-status-sidebar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.status-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.status-indicator {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--lime-primary);
}

.status-card {
    background-color: var(--bg-charcoal);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.game-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.server-ip {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.status-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.online span {
    color: var(--lime-primary);
}

.status-badge.offline span {
    color: #ef4444; /* Red for maintenance/offline */
}

.status-badge small {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: normal;
}

.status-card-footer-link {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    color: var(--lime-primary);
    text-decoration: none;
    margin-top: 0.5rem;
    font-weight: 500;
}

.status-card-footer-link:hover {
    text-decoration: underline;
}

/* ==========================================
   6. Sections General (Features & Projects)
   ================================---------- */
.features, .projects {
    padding: 5rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ==========================================
   7. Grids & Cards (Features & Projects Grids)
   ================================---------- */
.features-grid, .projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.feature-card, .project-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform var(--transition-speed), border-color var(--transition-speed);
}

.feature-card:hover, .project-card:hover {
    transform: translateY(-4px);
    border-color: var(--lime-primary);
}

.feature-icon img {
    width: 32px;
    height: 32px;
    opacity: 0.9;
}

.feature-card h3, .project-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.feature-card p, .project-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.project-tag {
    font-size: 0.75rem;
    font-weight: 600;
    background-color: rgba(132, 204, 22, 0.1);
    color: var(--lime-primary);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    border: 1px solid rgba(132, 204, 22, 0.2);
}

.project-footer {
    margin-top: auto;
    padding-top: 1rem;
}

/* ==========================================
   8. Footer Styles
   ================================---------- */
.site-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    padding: 4rem 5% 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    height: 32px;
    width: auto;
    margin-bottom: 1rem;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 350px;
}

.footer-links h4, .footer-contact h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links ul, .footer-contact ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a, .footer-contact a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition-speed);
}

.footer-links a:hover, .footer-contact a:hover {
    color: var(--lime-primary);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==========================================
   9. Responsive Design (Mobile Breakpoints)
   ================================---------- */
@media (max-width: 1024px) {
    .hero-three-col {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
        gap: 3rem;
    }
    
    .hero-col.hero-left {
        display: none; /* Hide empty spacer on mobile */
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-links ul {
        gap: 1rem;
    }

    .hero {
        padding: 3rem 1rem;
    }
}

/* ==========================================
   10. Game Servers Page Styles
   ================================---------- */
.servers-page-content {
    padding: 4rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.servers-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.server-detail-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: border-color var(--transition-speed);
}

.server-detail-card:hover {
    border-color: var(--lime-primary);
}

.server-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.server-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.server-title-group h3 {
    font-size: 1.35rem;
    font-weight: 700;
}

.server-ip-badge {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--lime-primary);
    background-color: rgba(132, 204, 22, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    width: fit-content;
    border: 1px solid rgba(132, 204, 22, 0.2);
}

.server-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.meta-box {
    background-color: var(--bg-charcoal);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.server-description h4, 
.server-modlist-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.server-description p, 
.guide-text {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.modlist {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modlist a {
    color: var(--lime-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: gap var(--transition-speed);
}

.modlist a:hover {
    text-decoration: underline;
}

/* Active Nav Link Indicator */
.nav-links a.active {
    color: var(--lime-primary);
}

/* ==========================================
   11. About Page Styles
   ================================---------- */
.about-page-content {
    padding: 4rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.about-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.about-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.about-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.specs-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.specs-list li {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.specs-list strong {
    color: var(--text-main);
}

/* ==========================================
   12. Documentation Page Styles
   ================================---------- */
.docs-layout {
    display: grid;
    grid-template-columns: 260px 1fr 220px;
    max-width: 1500px;
    margin: 0 auto;
    width: 100%;
    min-height: calc(100vh - 80px);
}

/* Left Navigation Sidebar */
.docs-sidebar {
    background-color: var(--bg-charcoal);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 73px;
    height: calc(100vh - 73px);
    overflow-y: auto;
}

.docs-search-box input {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    color: var(--text-main);
    font-size: 0.85rem;
    outline: none;
}

.docs-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.docs-nav-group h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.docs-nav-group ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.docs-nav-group a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-speed);
}

.docs-nav-group a:hover,
.docs-nav-group a.active {
    color: var(--lime-primary);
}

/* Center Content Area */
.docs-content {
    padding: 3rem 4%;
    max-width: 900px;
}

.doc-article {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.doc-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.doc-category {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--lime-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.doc-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0.5rem 0 1rem;
}

.doc-lead {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.doc-section {
    scroll-margin-top: 100px; /* This creates a 100px buffer so titles stay fully visible */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.doc-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.doc-section p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Code Snippet Formatting */
.code-block-wrapper {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.code-header {
    background-color: #1f232b;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.code-block-wrapper pre {
    padding: 1rem;
    overflow-x: auto;
}

.code-block-wrapper code {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--lime-primary);
}

/* Right TOC Sidebar */
.docs-toc-sidebar {
    background-color: var(--bg-charcoal);
    border-left: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    position: sticky;
    top: 73px;
    height: calc(100vh - 73px);
    overflow-y: auto;
}

.docs-toc-sidebar h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.docs-toc-sidebar ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.docs-toc-sidebar a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color var(--transition-speed);
}

.docs-toc-sidebar a:hover {
    color: var(--lime-primary);
}

/* Responsive collapse for smaller screens */
@media (max-width: 1024px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }
    .docs-sidebar, .docs-toc-sidebar {
        display: none;
    }
    .docs-content {
        padding: 2rem 5%;
    }
}

/* ==========================================
   13. Community Page Styles
   ================================---------- */
.community-page-content {
    padding: 4rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.community-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
    transition: border-color var(--transition-speed), transform var(--transition-speed);
}

.community-card:hover {
    border-color: var(--lime-primary);
    transform: translateY(-2px);
}

.community-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.community-card-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.badge-tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--lime-primary);
    background-color: rgba(132, 204, 22, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(132, 204, 22, 0.2);
}

.badge-tag.upcoming {
    color: var(--text-muted);
    background-color: rgba(156, 163, 175, 0.1);
    border-color: rgba(156, 163, 175, 0.2);
}

.community-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.community-action {
    padding-top: 0.5rem;
}

.disabled-link-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}