:root {
    /* Light Mode (Base) */
    --bg-color: #f4f6f8;
    --bg-alt-color: #e9ecef;
    --text-color: #2c3e50;
    --text-muted-color: #5c6873;
    --heading-color: #1a252f;
    --link-color: #4a90e2;
    --link-hover-color: #357abd;
    --highlight-color: #4a90e2; 
    
    /* Glass Panel Colors - Light */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: rgba(0, 0, 0, 0.05);
    --glass-hover-bg: rgba(255, 255, 255, 0.85);

    --nav-bg: rgba(255, 255, 255, 0.8);
    --nav-text: #2c3e50;
    
    --footer-bg-color: #1a252f;
    --footer-text-color: #bdc3c7;
    --footer-link-color: #95a5a6;
    --footer-link-hover-color: #ffffff;
    
    --section-overlay-bg: rgba(255, 255, 255, 0.1); 
}

body[data-theme="dark"] {
    /* Dark Mode (Premium Gaming Feel) */
    --bg-color: #0d1117;
    --bg-alt-color: #161b22;
    --text-color: #c9d1d9;
    --text-muted-color: #8b949e;
    --heading-color: #ffffff;
    --link-color: #58a6ff;
    --link-hover-color: #79c0ff;
    --highlight-color: #58a6ff;
    
    /* Glass Panel Colors - Dark */
    --glass-bg: rgba(22, 27, 34, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: rgba(0, 0, 0, 0.5);
    --glass-hover-bg: rgba(33, 38, 45, 0.85);

    --nav-bg: rgba(13, 17, 23, 0.85);
    --nav-text: #ffffff;
    
    --footer-bg-color: #010409;
    --footer-text-color: #8b949e;
    --footer-link-color: #c9d1d9;
    --footer-link-hover-color: #ffffff;
    
    --section-overlay-bg: rgba(0, 0, 0, 0.7);
    color-scheme: dark;
}

/* --- Global Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    font-family: 'Raleway', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
    scroll-behavior: smooth;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--heading-color);
    margin-top: 0;
    margin-bottom: 0.5em;
    transition: color 0.4s ease;
}

p {
    line-height: 1.7;
    transition: color 0.4s ease;
}

.section-padding {
    padding: 80px 0;
}

.alternate-bg {
    background-color: var(--bg-alt-color);
}

.parallax-bg {
    background-attachment: fixed;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}

/* --- Glassmorphism Core Classes --- */
.glass-panel, .glass-card, .glass-modal, .glass-nav {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px var(--glass-shadow);
    transition: all 0.4s ease;
}

.glass-card {
    border-radius: 16px;
    padding: 30px;
}

.glass-card:hover {
    transform: translateY(-5px);
    background: var(--glass-hover-bg);
    box-shadow: 0 12px 40px var(--glass-shadow);
    border-color: var(--highlight-color);
}

/* --- Buttons --- */
.btn {
    border-radius: 50px;
    padding: 12px 35px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    transition: all 0.3s ease;
}

.btn-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--heading-color);
    box-shadow: 0 4px 15px var(--glass-shadow);
}

.btn-glass:hover {
    background: var(--highlight-color);
    color: #fff;
    transform: translateY(-2px);
    border-color: var(--highlight-color);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
}

.btn-primary {
    background-color: var(--highlight-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    background-color: var(--link-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.5);
}

/* --- Navbar --- */
.navbar-default {
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: none;
    border-bottom: 1px solid var(--glass-border);
    text-transform: uppercase;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    padding: 8px 0; 
    transition: all 0.4s ease;
    z-index: 1030;
}

.nav-flex-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap; 
}

.navbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%; 
}

/* Hard-Lock Mobile Button Margins to Prevent Stutter */
.navbar-default .navbar-toggle {
    margin: 0; 
    padding: 10px 12px;
    border-color: var(--glass-border);
    transition: all 0.3s ease;
}
.navbar-default .navbar-toggle .icon-bar {
    background-color: var(--nav-text);
}
.navbar-default .navbar-toggle:hover, 
.navbar-default .navbar-toggle:focus {
    background-color: var(--glass-hover-bg);
}

.navbar-buttons-mobile {
    display: flex;
    align-items: center;
    gap: 5px; 
    margin: 0;
}

#minecraft-navbar {
    width: 100%;
    border: none;
    box-shadow: none;
    padding: 0;
}

.navbar-nav {
    margin: 0;
    padding: 0; 
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Kill Bootstrap's legacy invisible pseudo-elements globally 
   to stop them from interfering with Flexbox and Grid calculations */
.navbar-nav::before,
.navbar-nav::after {
    display: none !important;
}

.navbar-default .navbar-nav > li > a {
    color: var(--nav-text);
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li.current > a {
    background-color: var(--highlight-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

/* Nav Icons */
.btn-nav-icon {
    background: transparent;
    border: none;
    color: var(--nav-text);
    font-size: 18px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-nav-icon:hover {
    background: var(--glass-border);
    color: var(--highlight-color);
}

.mobile-only { display: none; }

/* Desktop overrides for Perfect Centering */
@media (min-width: 992px) {
    .nav-flex-wrapper { flex-wrap: nowrap; }
    .navbar-header { flex: 1 1 0%; width: auto; }
    #minecraft-navbar {
        flex: 0 0 auto;
        display: flex !important; 
        width: auto;
        justify-content: center;
    }
    .navbar-utility-desktop {
        flex: 1 1 0%;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }
}

/* --- Header --- */
header {
    background-image: url('../img/header.jpg'); 
    background-position: center center;
    background-size: cover;
    padding-top: 160px;
    padding-bottom: 100px;
    position: relative;
    text-align: center;
}

header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), var(--bg-color));
    z-index: 1;
}

.banner-content {
    position: relative;
    z-index: 2;
}

.termina-logo {
    display: block;
    margin: 0 auto 40px auto;
    max-width: 500px;
    width: 90%;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.termina-logo:hover {
    transform: scale(1.05);
}

.server-info.links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

#server-status {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 600;
    color: var(--heading-color);
}
.server-online { color: #2ecc71; text-shadow: 0 0 10px rgba(46, 204, 113, 0.5); }
.server-offline { color: #e74c3c; }

/* --- Ticker --- */
#news-ticker {
    display: inline-block;
    padding: 8px 25px;
    border-radius: 50px;
    margin-bottom: 30px;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--heading-color);
}

.ticker-label { color: var(--highlight-color); margin-right: 10px; }

/* --- Typography Formatting --- */
h1 span {
    color: var(--highlight-color);
}

.section-padding h1 {
    font-size: 36px;
    margin-bottom: 60px;
    line-height: 1.3;
}

/* --- Features Section --- */
.feature-item { margin-bottom: 30px; text-align: center; }
.feature-img {
    width: 90px;
    height: 90px;
    border-radius: 20px;
    margin: 0 auto 20px;
    object-fit: cover;
    box-shadow: 0 8px 20px var(--glass-shadow);
}
.feature-item h3 { font-size: 22px; margin-bottom: 15px; }

code {
    background: var(--glass-bg);
    color: var(--highlight-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: monospace;
    border: 1px solid var(--glass-border);
}

/* --- Team Section --- */
.team-list {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}
.team-member {
    flex: 1 1 300px;
    max-width: 350px;
    text-align: center;
}
.team-avatar {
    width: 120px; height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    border: 4px solid var(--glass-border);
    object-fit: cover;
}
.label {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.label-danger { background-color: #e74c3c; }
.label-success { background-color: #2ecc71; }

/* --- Parallax Overlay & Section Backgrounds --- */
#about {
    background-image: url('../img/banner.jpg');
}

#donate {
    background-image: url('../img/donate-banner.jpg');
}

#about, #donate {
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

#about h1, #donate h1 {
    color: #fff;
}

#about p, #donate p {
    color: rgba(255, 255, 255, 0.95);
}

#about::before, #donate::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--section-overlay-bg);
    z-index: 1;
}

#about .container, #donate .container {
    position: relative;
    z-index: 2;
}

/* --- Servers/Towns --- */
.town-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--glass-border);
}

/* --- Testimonials --- */
blockquote.glass-panel {
    border-left: 5px solid var(--highlight-color);
    padding: 30px;
    margin: 0;
    border-radius: 0 16px 16px 0;
}
blockquote p { font-style: italic; font-size: 1.1em; }

/* Scoped reset so it doesn't get main footer properties */
blockquote footer { 
    background-color: transparent;
    padding: 0;
    font-weight: 700; 
    color: var(--highlight-color); 
    text-align: right; 
    margin-top: 15px;
}
blockquote footer::before { content: '— '; }

/* --- Footer --- */
footer.container-fluid {
    background-color: var(--footer-bg-color);
    color: var(--footer-text-color);
    padding: 60px 0 30px;
}
footer.container-fluid h2 span { color: var(--highlight-color); }
.footer-spacer {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 20px 0;
}
.footer-nav a {
    color: var(--footer-link-color);
    text-transform: uppercase;
    font-weight: 600;
    font-size: 14px;
    margin-right: 15px;
}
.footer-nav a:hover { color: var(--highlight-color); }
.social-icons a {
    color: var(--footer-link-color);
    font-size: 24px;
    margin-right: 15px;
    transition: all 0.3s ease;
}
.social-icons a:hover {
    color: var(--highlight-color);
    transform: translateY(-5px);
}

/* --- Utilities --- */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: none;
    z-index: 1000;
    font-size: 20px;
    line-height: 25px; 
}

#scroll-progress-bar-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 4px;
    z-index: 1050;
    background: transparent;
}
#scroll-progress-bar {
    height: 100%;
    background: var(--highlight-color);
    box-shadow: 0 0 10px var(--highlight-color);
    width: 0%;
}

/* Copied Notification */
#copy-notification {
    position: fixed;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--highlight-color);
    color: #fff;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    z-index: 2000;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#copy-notification.show { bottom: 30px; }

/* Music Player Animation */
@keyframes pulseGlow {
    0% { color: var(--nav-text); text-shadow: none; }
    50% { color: #2ecc71; text-shadow: 0 0 15px #2ecc71; }
    100% { color: var(--nav-text); text-shadow: none; }
}
.btn-nav-icon.playing i { animation: pulseGlow 2s infinite; }

/* --- Mobile Responsiveness (The 2-Column Grid Upgrade) --- */
@media (max-width: 991px) {
    .navbar-utility-desktop { display: none; }
    
    .nav-flex-wrapper {
        position: relative; /* Acts as an anchor for the absolute menu */
    }

    /* Detach the menu from the flow to prevent ALL stuttering */
    #minecraft-navbar {
        position: absolute;
        top: 100%;
        left: 15px; /* Aligns perfectly with the container's inner padding */
        right: 15px;
        width: auto;
        padding: 0;
        z-index: 1050;
    }

    /* Create a flawless 2-column grid for the dropdown */
    .navbar-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
        background: var(--glass-bg);
        border-radius: 12px;
        padding: 12px;
        margin: 10px 0 15px 0; 
        box-shadow: 0 8px 32px var(--glass-shadow);
    }

    .navbar-default .navbar-nav > li { 
        width: 100%; 
    }
    
    /* Ensure the links perfectly fill the grid cells */
    .navbar-default .navbar-nav > li > a { 
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        width: 100%; 
        height: 100%;
        padding: 12px 5px;
        font-size: 13px; 
    }

    .mobile-only { display: block; }
    
    .server-info.links { flex-direction: column; align-items: center; }
    .btn { width: 100%; max-width: 300px; margin-bottom: 10px; }
}