:root {
    --bg-main: #050814;
    --bg-panel: #0b1020;
    --accent: #3fd5ff;
    --accent-soft: #1b8fd1;
    --text-main: #e9f3ff;
    --text-muted: #9bb3d4;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-main);

    background:
        radial-gradient(
            circle at 15% 40%,
            rgba(0,180,255,0.22) 0%,
            rgba(0,180,255,0.14) 30%,
            rgba(0,180,255,0.08) 60%,
            rgba(0,180,255,0.03) 85%,
            transparent 100%
        ),
        radial-gradient(
            circle at 85% 60%,
            rgba(140,0,255,0.20) 0%,
            rgba(140,0,255,0.12) 35%,
            rgba(140,0,255,0.06) 65%,
            rgba(140,0,255,0.03) 90%,
            transparent 100%
        ),
        #050814;

    overflow-x: hidden;
}

body::before,
body::after {
    content:"";
    position:fixed;
    inset:0;
    pointer-events:none;
    z-index:-1;
    background-image:
        radial-gradient(2px 2px at 5% 10%, #fff, transparent),
        radial-gradient(2px 2px at 15% 30%, rgba(255,255,255,.9), transparent),
        radial-gradient(1px 1px at 25% 70%, rgba(255,255,255,.8), transparent),
        radial-gradient(2px 2px at 40% 20%, #fff, transparent),
        radial-gradient(1px 1px at 55% 40%, rgba(255,255,255,.8), transparent),
        radial-gradient(2px 2px at 70% 15%, #fff, transparent),
        radial-gradient(1px 1px at 80% 65%, rgba(255,255,255,.9), transparent),
        radial-gradient(2px 2px at 90% 45%, #fff, transparent),
        radial-gradient(1px 1px at 10% 90%, rgba(255,255,255,.8), transparent),
        radial-gradient(2px 2px at 60% 90%, rgba(255,255,255,.9), transparent);
    background-size:600px 600px;
    opacity:.9;
    animation:starDrift 25s linear infinite, twinkle 4s ease-in-out infinite;
}

body::after {
    background-size:350px 350px;
    opacity:.5;
    animation:starDriftReverse 40s linear infinite, twinkle 6s ease-in-out infinite;
}

@keyframes starDrift { 
    from { transform:translate(0,0) } 
    to { transform:translate(-300px,-300px) } 
}

@keyframes starDriftReverse { 
    from { transform:translate(0,0) } 
    to { transform:translate(300px,300px) } 
}

/* NAVIGATION */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: var(--bg-panel);
    border-bottom: 1px solid rgba(63,213,255,0.25);
}

nav .logo {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--accent);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

nav ul li {
    cursor: pointer;
    color: var(--text-main);
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background: var(--bg-panel);
    padding: 10px;
    border-radius: 8px;
    top: 24px;
    left: 0;
    border: 1px solid rgba(63,213,255,0.25);
}

.dropdown-menu li {
    padding: 6px 10px;
    color: var(--text-muted);
}

.dropdown-menu li:hover {
    color: var(--accent);
}

/* HERO */
.hero {
    text-align: center;
    padding: 60px 20px;
}

.hero h1 {
    font-size: 2rem;
}

.hero p {
    color: var(--text-muted);
}

.hero button {
    margin-top: 20px;
    padding: 12px 20px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* QUICK LINKS */
.quick-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 40px 20px;
}

.link-box {
    background: var(--bg-panel);
    padding: 20px;
    width: 200px;
    border-radius: 14px;
    text-align: center;
    border: 1px solid rgba(63,213,255,0.25);
    transition: 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.link-box::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at top, rgba(63,213,255,0.18), transparent 60%);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
    pointer-events: none;
}

.link-box:hover::before {
    opacity: 1;
}

.link-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 26px rgba(63,213,255,0.45);
    border-color: rgba(63,213,255,0.6);
}

.link-box h3 {
    margin: 10px 0 6px;
    font-size: 1.05rem;
}

.link-box p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.outlook-box img {
    width: 42px;
    margin-bottom: 6px;
}

/* ANNOUNCEMENTS */
.announcements {
    background: radial-gradient(circle at top left, #18213b, #050814);
    margin: 20px auto 40px;
    padding: 26px 26px;
    width: 80%;
    border-radius: 16px;
    box-shadow: 0 0 24px rgba(0,0,0,0.7);
    border: 1px solid rgba(63,213,255,0.35);

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.planet-text {
    flex: 1;
}

.planet-text h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.3rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

#quoteText {
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-main);
}

#quoteAuthor {
    margin-top: 8px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.planet-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.planet-image img {
    width: 100%;
    max-width: 280px;
    border-radius: 14px;
    box-shadow: 0 0 26px rgba(63,213,255,0.55);
    border: 1px solid rgba(63,213,255,0.6);
    background: #000;
}

/* FOOTER */
footer {
    text-align: center;
    padding: 18px;
    background: linear-gradient(to right, #050814, #0b1020);
    color: var(--text-muted);
    border-top: 1px solid rgba(63,213,255,0.25);
    font-size: 0.85rem;
}

/* ⭐ MODAL — UPDATED & FIXED */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(5,8,20,0.85);
    backdrop-filter: blur(10px);

    /* Prevent dropdown from instantly closing */
    pointer-events: none;
}

.modal.active {
    display: block;
    pointer-events: auto;
}

.modal-content {
    background: radial-gradient(circle at top left, #18213b, #050814);
    width: 420px;
    margin: 10% auto;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    border: 1px solid rgba(63,213,255,0.4);
    animation: fadeIn 0.3s ease;
    color: var(--text-main);
}

.close {
    float: right;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
}

.close:hover {
    color: var(--accent);
}

.directory-list {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

.directory-list li {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.directory-list li:hover {
    background: rgba(63,213,255,0.08);
    color: var(--text-main);
}

body.login {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.login .hero {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

body.login footer {
    flex-shrink: 0;
}

.pfp-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
    vertical-align: middle;
    border: 2px solid var(--accent-soft);
}
.admin-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.link-box {
    background: rgba(63, 213, 255, 0.12);
    border: 1px solid rgba(63, 213, 255, 0.35);
    border-radius: 10px;
    color: var(--accent-soft);
    transition: 0.25s ease;
    backdrop-filter: blur(4px);
}

.link-box:hover {
    background: rgba(63, 213, 255, 0.22);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px rgba(63, 213, 255, 0.45);
    transform: translateY(-2px);
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-main);
}

.user-table th {
    padding: 12px;
    color: var(--accent-soft);
    text-align: left;
    border-bottom: 1px solid rgba(63,213,255,0.25);
}

.user-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(63,213,255,0.15);
}

.pfp-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-soft);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-action {
    background: rgba(63,213,255,0.15);
    border: 1px solid rgba(63,213,255,0.35);
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-main);
    transition: 0.2s;
}

.btn-action:hover {
    background: rgba(63,213,255,0.25);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(63,213,255,0.45);
}

.btn-action.delete:hover {
    background: rgba(255,80,80,0.25);
    border-color: #ff4d4d;
}

.ban-none {
    color: var(--text-muted);
}

.ban-active {
    color: #ff6b6b;
    font-weight: bold;
}

#adminModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5,8,20,0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
}

#adminModal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

#adminModalContent {
    background: var(--bg-panel);
    padding: 24px;
    border-radius: 16px;
    width: 350px;
    border: 1px solid rgba(63,213,255,0.35);
    box-shadow: 0 0 26px rgba(0,0,0,0.45);
}
.page-wrapper {
    min-height: calc(100vh - 145px); /* navbar + footer height */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999; /* IMPORTANT */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    background: var(--bg-panel);
    margin: 10% auto;
    padding: 20px;
    border-radius: 12px;
    width: 60%;
    max-width: 500px;
    position: relative;
    z-index: 10000; /* IMPORTANT */
}

.close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 28px;
    cursor: pointer;
    color: var(--accent);
    z-index: 10001; /* IMPORTANT */
}

#adminPasswordModal {
    z-index: 99999 !important;
}

