@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
    --fallback-bg-dark: url('/assets/background-load-night.jpeg');
    --fallback-bg-light: url('/assets/background-load.jpg');
    --bg-color-dark: #121212;
    --text-primary-dark: #ffffff;
    --text-secondary-dark: #b3b3b3;
    --surface-dark: rgba(28, 28, 28, 0.7);
    --overlay-dark: rgba(0, 0, 0, 0.6);
    --highlight-dark: #ffffff;
    --highlight-text-dark: #121212;
    --sidebar-active-bg-dark: rgba(255, 255, 255, 0.15);
    --sidebar-hover-bg-dark: rgba(255, 255, 255, 0.08);

    --bg-color-light: #f0f2f5;
    --text-primary-light: #1c1e21;
    --text-secondary-light: #606770;
    --surface-light: rgba(255, 255, 255, 0.75);
    --overlay-light: rgba(0, 0, 0, 0.2);
    --highlight-light: #1877f2;
    --highlight-text-light: #ffffff;
    --sidebar-active-bg-light: rgba(24, 119, 242, 0.15);
    --sidebar-hover-bg-light: rgba(0, 0, 0, 0.05);
}

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

html {
    height: 100%;
    background-color: var(--bg-color-dark);
    overflow-x: hidden;
}
html.light-theme { background-color: var(--bg-color-light); }

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: transparent;
    color: var(--text-primary-dark);
    display: flex; flex-direction: column;
    min-height: 100dvh;
    transition: color 0.4s ease;
}
body.light-theme {
    color: var(--text-primary-light);
}

#page-loader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 1; transition: opacity 0.5s ease; }
#page-loader.fade-out { opacity: 0; visibility: hidden; transition-delay: 0.5s; }
.progress-bar-wrapper { width: 80%; max-width: 600px; height: 6px; background-color: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; margin-top: 20vh; position: relative; }
body.light-theme .progress-bar-wrapper { background-color: rgba(0, 0, 0, 0.1); }
#progress-bar { width: 0%; height: 100%; background-color: var(--text-primary-dark); border-radius: 3px; transition: width 0.5s ease-out; }
body.light-theme #progress-bar { background-color: var(--text-primary-light); }
.progress-bar-wrapper::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; transform: translateX(-100%); background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%); animation: shimmer 1.5s infinite; }
body.light-theme .progress-bar-wrapper::after { background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0) 100%); }
@keyframes shimmer { 100% { transform: translateX(100%); } }

body.is-loading > header,
body.is-loading > main,
body.is-loading > footer {
    opacity: 0;
}

header, main, footer {
    opacity: 1;
    transition: opacity 0.6s ease-out 0.4s;
}

.video-background {
    position: fixed;
    top: 50%; left: 50%;
    width: 110vw; height: 110dvh;
    transform: translate(-50%, -50%);
    backface-visibility: hidden;
    will-change: transform, filter;
    z-index: -2;
    background-size: cover;
    background-position: center;
    background-image: var(--fallback-bg-dark);
    filter: blur(16px);
    transition: filter 1s ease-out, background-image 0.4s ease;
}
body:not(.is-loading) .video-background {
    filter: blur(4px);
}
#bg-video {
    width: 100%; height: 100%;
    object-fit: cover; opacity: 0; transition: opacity 1.5s ease;
}
#bg-video.visible { opacity: 1; }
.video-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--overlay-dark); transition: background-color 0.4s ease; z-index: -1; }
body.light-theme .video-overlay { background-color: var(--overlay-light); }

#sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 80; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0s linear 0.4s; }
#sidebar-overlay.visible { opacity: 1; visibility: visible; transition-delay: 0s; }
#sidebar {
    position: fixed; top: 1rem; right: 1rem; width: 280px; height: calc(100% - 2rem);
    background-color: var(--surface-dark);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    z-index: 90;
    transform: translateX(calc(100% + 1rem)) translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.4s ease;
    border-radius: 16px;
}
body.light-theme #sidebar { background-color: var(--surface-light); }
#sidebar.open {
    transform: translateX(0) translateZ(0);
}
#sidebar-close { position: absolute; top: 1rem; right: 1rem; padding: 0.5rem; background: none; border: none; cursor: pointer; color: var(--text-secondary-dark); border-radius: 50%; display: flex; transition: background-color 0.2s ease, color 0.4s ease; }
body.light-theme #sidebar-close { color: var(--text-secondary-light); }
#sidebar-close:hover { background-color: rgba(255, 255, 255, 0.1); }
body.light-theme #sidebar-close:hover { background-color: rgba(0, 0, 0, 0.08); }
.sidebar-nav { margin-top: 4rem; display: flex; flex-direction: column; padding: 0 1rem; }
.sidebar-nav a { padding: 0.8rem 1rem; margin-bottom: 0.5rem; color: var(--text-secondary-dark); text-decoration: none; font-size: 1.1rem; border-radius: 8px; transition: background-color 0.2s ease, color 0.2s ease; }
body.light-theme .sidebar-nav a { color: var(--text-secondary-light); }
.sidebar-nav a:hover { color: var(--text-primary-dark); background-color: var(--sidebar-hover-bg-dark); }
body.light-theme .sidebar-nav a:hover { color: var(--text-primary-light); background-color: var(--sidebar-hover-bg-light); }
.sidebar-nav a.active { color: var(--text-primary-dark); font-weight: 700; background-color: var(--sidebar-active-bg-dark); }
body.light-theme .sidebar-nav a.active { color: var(--text-primary-light); background-color: var(--sidebar-active-bg-light); }

header { position: fixed; top: 0; left: 0; width: 100%; padding: 1.5rem 2rem; display: flex; justify-content: space-between; align-items: center; z-index: 10; }
.logo-container { display: flex; align-items: center; gap: 1rem; }
.server-title { font-size: 1.2rem; font-weight: 500; }
.top-nav { display: flex; align-items: center; gap: 1rem; }
.top-nav a, .top-nav button { color: var(--text-primary-dark); background: none; border: none; cursor: pointer; text-decoration: none; padding: 0.5rem; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background-color 0.2s ease, color 0.4s ease; }
body.light-theme .top-nav a, body.light-theme .top-nav button { color: var(--text-primary-light); }
.top-nav a:hover, .top-nav button:hover:not(.active) { background-color: rgba(255, 255, 255, 0.1); }
body.light-theme .top-nav a:hover, body.light-theme .top-nav button:hover:not(.active) { background-color: rgba(0, 0, 0, 0.05); }

.theme-controls { position: relative; display: flex; background-color: rgba(0,0,0,0.2); border-radius: 99px; padding: 4px; }
body.light-theme .theme-controls { background-color: rgba(0,0,0,0.05); }
.theme-controls button { padding: 0.3rem; z-index: 1; color: var(--text-secondary-dark); }
body.light-theme .theme-controls button { color: var(--text-secondary-light); }
.theme-controls button.active { color: var(--highlight-text-dark); }
body.light-theme .theme-controls button.active { color: var(--highlight-text-light); }
#theme-glider { position: absolute; top: 4px; left: 0; height: calc(100% - 8px); background-color: var(--highlight-dark); border-radius: 99px; transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.4s ease, width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
body.light-theme #theme-glider { background-color: var(--highlight-light); }

.content-wrapper { flex-grow: 1; display: flex; justify-content: center; align-items: center; text-align: center; padding: 1rem; }
.intro-box { max-width: 600px; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.welcome-text, .announcement-box { display: flex; align-items: center; gap: 1rem; background-color: var(--surface-dark); padding: 1rem 1.5rem; border-radius: 16px; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); transition: background-color 0.4s ease; }
body.light-theme .welcome-text, body.light-theme .announcement-box { background-color: var(--surface-light); }
.waving-hand { font-size: 1.5rem; animation: wave-animation 2.5s infinite; transform-origin: 70% 70%; display: inline-block; }
@keyframes wave-animation { 0% { transform: rotate( 0.0deg) } 10% { transform: rotate(14.0deg) } 20% { transform: rotate(-8.0deg) } 30% { transform: rotate(14.0deg) } 40% { transform: rotate(-4.0deg) } 50% { transform: rotate(10.0deg) } 60% { transform: rotate( 0.0deg) } 100% { transform: rotate( 0.0deg) } }
.welcome-text p { font-size: 1.1rem; line-height: 1.6; }
.announcement-box { width: 100%; text-align: left; }
.announcement-box .material-icons { color: #f1c40f; }
.announcement-box p { font-size: 1rem; line-height: 1.5; color: var(--text-secondary-dark); }
body.light-theme .announcement-box p { color: var(--text-secondary-light); }
.action-buttons { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.btn { display: inline-flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1.8rem; border: none; border-radius: 12px; text-decoration: none; font-size: 1rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; }
.btn:hover { transform: translateY(-3px); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.btn-primary { background-color: var(--highlight-dark); color: var(--highlight-text-dark); }
body.light-theme .btn-primary { background-color: var(--highlight-light); color: var(--highlight-text-light); }

footer { position: fixed; bottom: 0; left: 0; width: 100%; padding: 1.5rem 2rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; color: var(--text-secondary-dark); z-index: 10; }
body.light-theme footer { color: var(--text-secondary-light); }
.social-links { display: flex; align-items: center; gap: 0.75rem; }
.social-links a { color: var(--text-secondary-dark); text-decoration: none; transition: color 0.2s ease; }
body.light-theme .social-links a { color: var(--text-secondary-light); }
.social-links a:hover { color: var(--text-primary-dark); }
body.light-theme .social-links a:hover { color: var(--text-primary-light); }

@media (max-width: 768px) {
    header, footer { padding: 1rem 1.5rem; }
    .server-title { font-size: 1rem; }
    .welcome-text p, .announcement-box p { font-size: 0.95rem; }
    .btn { padding: 0.8rem 1.5rem; font-size: 0.9rem; }
    footer { flex-direction: column-reverse; gap: 1rem; text-align: center; }
}

.top-nav a,
.top-nav button,
#sidebar-close,
.sidebar-nav a,
.btn,
.social-links a {
    outline: none;
    transition: box-shadow 0.2s ease;
}

.top-nav a:focus-visible,
.top-nav button:focus-visible,
#sidebar-close:focus-visible,
.sidebar-nav a:focus-visible,
.btn:focus-visible,
.social-links a:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6);
}

.light-theme .top-nav a:focus-visible,
.light-theme .top-nav button:focus-visible,
.light-theme #sidebar-close:focus-visible,
.light-theme .sidebar-nav a:focus-visible,
.light-theme .btn:focus-visible,
.light-theme .social-links a:focus-visible {
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.7);
}