/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* BODY */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #000;
    color: #d1d1d1;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* STARFIELD LAYERS */
.stars, .stars2, .stars3 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-repeat: repeat;
}

.stars {
    background-image: url('/assets/img/stars-small.png');
    animation: drift 200s linear infinite;
    opacity: 0.6;
}

.stars2 {
    background-image: url('/assets/img/stars-medium.png');
    animation: drift 300s linear infinite;
    opacity: 0.8;
}

.stars3 {
    background-image: url('/assets/img/stars-large.png');
    animation: drift 450s linear infinite;
    opacity: 1;
}

@keyframes drift {
    from { background-position: 0 0; }
    to { background-position: -5000px 5000px; }
}

/* SECTION BACKGROUNDS */
.section-classic,
.section-soft,
.section-dreamy,
.section-haze {
    background-repeat: repeat;
    background-size: auto;
    border-radius: 16px;
    padding: 40px;
    backdrop-filter: blur(6px);
    position: relative;
    z-index: 1;
}

.section-classic { background: url('/assets/img/stars-classic.jpg'); box-shadow: 0 0 40px #f5f3ff; }
.section-soft    { background: url('/assets/img/stars-soft.jpg');    box-shadow: 0 0 40px #9b4dff55; }
.section-dreamy  { background: url('/assets/img/stars-dreamy.jpg');  box-shadow: 0 0 40px #ff88ff55; }
.section-haze    { background: url('/assets/img/stars-haze.jpg');    box-shadow: 0 0 40px #88ccff55; }

/* HEADER */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 35px;
    background: linear-gradient(to bottom, #050505ea, #000000ee);
    border-bottom: 1px solid #2b174a;
    box-shadow: 0 0 25px #9b4dff33;
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo-wrap { display: flex; align-items: center; }
.logo-link { display: inline-flex; align-items: center; text-decoration: none; }

.site-logo {
    height: 72px;
    width: auto;
    animation: logoPulse 9s ease-in-out infinite;
}

@keyframes logoPulse {
    0%   { filter: drop-shadow(0 0 10px #9b4dff88); transform: rotate(0deg) scale(1); }
    50%  { filter: drop-shadow(0 0 20px #c084fcff); transform: rotate(1deg) scale(1.03); }
    100% { filter: drop-shadow(0 0 10px #9b4dff88); transform: rotate(0deg) scale(1); }
}

.site-title {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f5f3ff;
    text-shadow: 0 0 10px #c084fcaa;
}

/* NAVIGATION */
.main-nav a {
    margin-left: 16px;
    color: #e5e5ff;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.main-nav a:hover {
    background: #9b4dff33;
    box-shadow: 0 0 12px #9b4dffaa;
    transform: translateY(-1px);
    color: #ffffff;
}

.discord-link {
    border: 1px solid #9b4dffaa;
    background: linear-gradient(135deg, #9b4dff33, #1f2933);
}

.main-nav .active {
    border-bottom: 2px solid #fff;
    font-weight: bold;
}

/* PAGE CONTENT */
.page-content {
    padding: 32px;
    max-width: 1100px;
    margin: 0 auto;
    animation: fadeUp 0.6s ease-out;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* FOOTER */
.site-footer {
    padding: 16px;
    text-align: center;
    font-size: 0.8rem;
    border-top: 1px solid #2b174a;
    background: #050506ee;
    margin-top: 40px;
}

/* BUTTONS */
.glow-button {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #f5f3ff;
    background: linear-gradient(135deg, #9b4dff33, #1f2933);
    border: 1px solid #9b4dffaa;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 0 12px #9b4dff55;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.glow-button:hover {
    background: #9b4dff55;
    box-shadow: 0 0 20px #c084fcaa, 0 0 40px #9b4dff88;
    transform: translateY(-2px);
    color: #ffffff;
}

/* LOGIN */
.login-container {
    max-width: 380px;
    margin: 120px auto;
    padding: 32px;
    background: rgba(10, 10, 20, 0.75);
    border: 1px solid #2b174a;
    border-radius: 12px;
    box-shadow: 0 0 25px #9b4dff33;
    text-align: center;
    backdrop-filter: blur(6px);
}

.login-title {
    font-size: 1.6rem;
    color: #f5f3ff;
    margin-bottom: 24px;
    text-shadow: 0 0 12px #c084fcaa;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-input {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #3b1a5a;
    background: #0a0a14;
    color: #e5e5ff;
    font-size: 1rem;
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.login-input:focus {
    border-color: #9b4dffaa;
    box-shadow: 0 0 12px #9b4dff55;
}

.login-btn { width: 100%; }

.login-note {
    margin-top: 16px;
    font-size: 0.85rem;
    color: #a78bfa;
    opacity: 0.8;
}

/* TABLES */
.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: #05050b;
    border: 1px solid #2b174a;
    box-shadow: 0 0 20px #9b4dff22;
}

.user-table th,
.user-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #1f102f;
    font-size: 0.9rem;
}

.user-table th {
    background: #12091f;
    color: #e5e5ff;
    text-align: left;
}

.user-table tr:nth-child(even) { background: #070713; }

/* GALLERY */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.gallery-item img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 0 20px #9b4dff55;
    transition: transform 0.2s ease;
}

.gallery-item img:hover { transform: scale(1.05); }

/* SIDEBAR */
.sidebar-button {
    display: block;
    background: #6a2cff;
    color: white;
    padding: 10px;
    margin-bottom: 10px;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.sidebar-button:hover { background: #8b4dff; }

.sidebar-upload label { display: block; margin-bottom: 6px; font-size: 14px; }
.sidebar-upload input[type="file"] { width: 100%; margin-bottom: 10px; }

.sidebar-upload button {
    width: 100%;
    padding: 8px;
    background: #6a2cff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.sidebar-upload button:hover { background: #8b4dff; }

.profile-card {
    background: rgba(40, 20, 70, 0.7);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 0 20px #9b4dff55;
    backdrop-filter: blur(6px);
}

.profile-avatar {
    width: 90px;
    height: 90px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: radial-gradient(circle, #b88cff, #6a2cff);
    box-shadow: 0 0 20px #9b4dffaa;
    animation: auraPulse 9s infinite ease-in-out;
}

@keyframes auraPulse {
    0% { box-shadow: 0 0 10px #9b4dff55; }
    50% { box-shadow: 0 0 25px #b88cffcc; }
    100% { box-shadow: 0 0 10px #9b4dff55; }
}

.cosmic-icons { display: flex; justify-content: space-around; margin-bottom: 20px; }

/* ICONS */
.icon {
    width: 25px;
    height: 25px;
    border-radius: 50%;
}

.icon.star {
    background: #ffffff;
    box-shadow: 0 0 10px #ffffffaa;
    animation: twinkle 2s infinite ease-in-out;
}

.icon.comet {
    background: #9b4dff;
    box-shadow: 0 0 15px #9b4dffaa;
    animation: drift 7s infinite linear;
}

.icon.spark {
    background: #ffdd88;
    box-shadow: 0 0 12px #ffdd88aa;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50%      { opacity: 1; transform: scale(1.2); }
}

@keyframes pulse {
    0%, 100% { transform: scale(0.9); opacity: 0.6; }
    50%      { transform: scale(1.3); opacity: 1; }
}

/* PLANETS */
.planet-container { display: flex; justify-content: center; margin-bottom: 25px; }

.planet {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle at 60% 90%, #b88cff, #6a2cff 70%);
    box-shadow: 0 0 25px #9b4dffcc, inset 0 0 25px #ffffff22;
    animation: rotatePlanet 9s linear infinite;
}

@keyframes rotatePlanet {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mini-planets { display: flex; justify-content: space-around; margin: 20px 0 35px; }

.tiny-planet {
    width: 32px;
    height: 32px;
    border-radius: 60%;
    animation: spin 10s linear infinite;
    box-shadow: 0 0 20px currentColor;
}

.tiny-planet.purple { background: radial-gradient(circle at 30% 30%, #d0a0ff, #7a2cff); color: #b88cff; }
.tiny-planet.blue   { background: radial-gradient(circle at 30% 30%, #a0d8ff, #2c6aff); color: #88ccff; }
.tiny-planet.gold   { background: radial-gradient(circle at 30% 30%, #ffe7a0, #ffb82c); color: #ffdd88; }

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* COSMIC PANELS */
.cosmic-panel {
    background: rgba(40, 10, 70, 0.35);
    border: 1px solid rgba(155, 77, 255, 0.4);
    border-radius: 16px;
    padding: 32px;
    margin: 40px auto;
    max-width: 900px;
    backdrop-filter: blur(12px);
    box-shadow: 0 0 25px rgba(155, 77, 255, 0.35), 0 0 60px rgba(120, 40, 255, 0.25);
    animation: floatPanel 12s ease-in-out infinite alternate;
    position: relative;
    z-index: 2;
}

@keyframes floatPanel {
    0%   { transform: translateY(0px) translateX(0px); }
    100% { transform: translateY(-12px) translateX(6px); }
}

.about-panel {
    max-width: 900px;
    margin: 60px auto;
    padding: 40px;
    background: rgba(30, 10, 50, 0.55);
    border-radius: 18px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 40px #ff88ff55;
    border: 1px solid rgba(255, 180, 255, 0.35);
}

/* SKY CLASSES */
.about-sky,
.faq-sky,
.gallery-sky {
    background-image: url('/assets/img/stars-magical.gif');
    background-repeat: repeat;
    background-size: auto;
    background-position: top left;
    background-attachment: fixed;
    color: #e8dfff;
}

/* DRAGON */
.floating-dragon {
    position: fixed;
    bottom: 10%;
    left: -160px;
    width: 120px;
    height: auto;
    z-index: 10;
    animation: swimDragon 60s linear infinite;
    pointer-events: none;
    filter: drop-shadow(0 0 10px #88ccff);
    background-image: url('/assets/img/dragon.png');
    background-size: contain;
    background-repeat: no-repeat;
}

@keyframes swimDragon {
    0%   { transform: translateX(0) rotate(0deg); }
    50%  { transform: translateX(120vw) rotate(5deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

/* DRAGON TRAIL */
.dragon-trail {
    position: fixed;
    bottom: 10%;
    left: -160px;
    width: 120px;
    height: 80px;
    z-index: 9;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%),
                radial-gradient(circle, rgba(255,200,255,0.2) 0%, transparent 70%),
                radial-gradient(circle, rgba(180,255,255,0.2) 0%, transparent 70%);
    animation: shimmerTrail 60s linear infinite;
    filter: blur(12px);
}

@keyframes shimmerTrail {
    0%   { transform: translateX(0); opacity: 0.6; }
    50%  { transform: translateX(120vw); opacity: 1; }
    100% { transform: translateX(0); opacity: 0.6; }
}

/* NEBULA RIPPLE */
.nebula-ripple {
    position: fixed;
    bottom: 6%;
    left: 0;
    width: 100vw;
    height: 220px;
    background: radial-gradient(circle at 20% 50%, rgba(255, 180, 255, 0.2), transparent 70%),
                radial-gradient(circle at 80% 50%, rgba(180, 255, 255, 0.2), transparent 70%);
    animation: rippleDrift 80s ease-in-out infinite;
    z-index: 5;
    pointer-events: none;
}

@keyframes rippleDrift {
    0%   { transform: translateX(0); }
    50%  { transform: translateX(-100px); }
    100% { transform: translateX(0); }
}

/* RIGHT SIDEBAR */
.right-sidebar {
    position: fixed;
    right: 20px;
    top: 150px;
    width: 260px;
    background: rgba(20, 10, 40, 0.7);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 0 25px #9b4dff55;
    backdrop-filter: blur(6px);
    color: #e5e5ff;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.right-sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(120deg, #9b4dff, #ff88ff, #88ccff, #9b4dff);
    background-size: 300% 300%;
    animation: holoGlow 6s ease infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
}

@keyframes holoGlow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* SIDEBAR TOGGLE — CLEAN SINGLE VERSION */
#sidebar-toggle {
    position: fixed;
    right: 20px;
    top: 70px;
    background: #6a2cff;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 15px #9b4dffaa;
    z-index: 9999;
    transition: background 0.2s ease;
    border: none;
}

#sidebar-toggle:hover {
    background: #8b4dff;
}

.sidebar-collapsed {
    transform: translateX(300px);
    opacity: 0;
}

/* RECENT PAGES */
.recent-pages ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-pages li {
    margin-bottom: 11px;
}

.recent-pages a {
    color: #caaaff;
    text-decoration: none;
}

.recent-pages a:hover {
    color: #ffffff;
}

/* COSMIC TEXT ELEMENTS */
.cosmic-quote {
    margin-top: 30px;
    font-style: italic;
    color: #d8caff;
    text-shadow: 0 0 15px #9b4dff55;
}

.cosmic-weather {
    margin-top: 30px;
    color: #e5d4ff;
}

/* NEBULA BACKGROUND */
.nebula {
    position: fixed;
    top: 0;
    left: 0;
    width: 120%;
    height: 120%;
    z-index: -2;
    background: radial-gradient(circle at 30% 40%, rgba(155, 77, 255, 0.25), transparent 60%),
                radial-gradient(circle at 70% 60%, rgba(255, 120, 255, 0.20), transparent 70%),
                radial-gradient(circle at 50% 80%, rgba(120, 200, 255, 0.15), transparent 80%);
    filter: blur(40px);
    animation: nebulaShift 40s ease-in-out infinite alternate;
}

@keyframes nebulaShift {
    0%   { transform: translate(0px, 0px) scale(1); }
    100% { transform: translate(-40px, 30px) scale(1.1); }
}

/* HEADER UTILITIES */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 999;
}

.transparent-header {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
    transition: background 0.3s ease;
}