:root {
    --primary: #991ddb; /* Your Bot's Purple Color */
    --accent: #5865F2;  /* Discord Blurple */
    --text: #ffffff;
    --glass-bg: rgba(30, 30, 30, 0.6); /* See-through dark */
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden; /* Prevents horizontal scrollbar due to animations */
    position: relative; /* Needed for absolute positioning of background */
    
    /* Keep the existing gradient base */
    background: linear-gradient(300deg, #0f0c29, #302b63, #24243e, #090113);
    background-size: 240% 240%;
    animation: gradientMove 15s ease infinite;
}

/* Container for all effects to keep them behind content */
.bg-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1; /* Puts it behind everything */
    overflow: hidden;
}

/* =========================
   EFFECT 1: DRIFTING STARS
   ========================= */
/* Uses box-shadows to create many small dots efficiently */
#stars, #stars2, #stars3 {
    position: absolute;
    top: 0; left: 0;
    background: transparent;
    border-radius: 50%;
    animation: animStar linear infinite;
}

/* Layer 1: Small, slow stars */
#stars {
    width: 1px; height: 1px;
    box-shadow: 12vw 15vh #fff, 35vw 42vh #fff, 82vw 12vh #fff, 55vw 85vh #fff, 10vw 70vh #fff, 92vw 54vh #fff, 32vw 92vh #fff, 68vw 32vh #fff;
    animation-duration: 50s;
    opacity: 0.5;
}

/* Layer 2: Medium stars */
#stars2 {
    width: 2px; height: 2px;
    box-shadow: 15vw 22vh #aaa, 38vw 45vh #aaa, 85vw 15vh #aaa, 58vw 88vh #aaa, 12vw 72vh #aaa, 94vw 56vh #aaa, 34vw 94vh #aaa, 70vw 35vh #aaa;
    animation-duration: 100s;
    opacity: 0.4;
}

/* Layer 3: Large, fast stars */
#stars3 {
    width: 3px; height: 3px;
    box-shadow: 18vw 25vh #ccc, 41vw 48vh #ccc, 88vw 18vh #ccc, 61vw 91vh #ccc, 15vw 75vh #ccc, 96vw 58vh #ccc, 36vw 96vh #ccc, 72vw 38vh #ccc;
    animation-duration: 150s;
    opacity: 0.3;
}

@keyframes animStar {
    from { transform: translateY(0px); }
    to   { transform: translateY(-2000px); } /* Moves stars upwards */
}

/* =========================
   EFFECT 2: FALLING METEORS
   ========================= */
.meteors {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    transform: rotateZ(-35deg); /* Angle the fall direction */
}

.meteors span {
    position: absolute;
    top: 50%; left: 50%; /* Start middle */
    width: 4px;
    height: 2px;
    background: #fff;
    opacity: 0; /* Hidden initially */
    border-radius: 50%;
    box-shadow: 0 0 15px 3px var(--primary); /* Glowing head */
    animation: meteor 4s linear infinite;
}

/* The Meteor Tail Gradient */
.meteors span::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 150px; /* Length of tail */
    height: 1px;
    background: linear-gradient(90deg, #fff, transparent);
}

/* Randomize Meteor Timing & Position */
.meteors span:nth-child(1) { top: 10%; left: 80%; animation-delay: 0s; animation-duration: 4s; }
.meteors span:nth-child(2) { top: 20%; left: 40%; animation-delay: 2.5s; animation-duration: 6s; }
.meteors span:nth-child(3) { top: 60%; left: 90%; animation-delay: 1.2s; animation-duration: 3s; }
.meteors span:nth-child(4) { top: -10%; left: 20%; animation-delay: 3.8s; animation-duration: 5s; }

@keyframes meteor {
    0%   { opacity: 0; transform: translateX(0); }
    10%  { opacity: 1; } /* Fade in quickly */
    80%  { opacity: 1; }
    100% { opacity: 0; transform: translateX(-800px); } /* Move left and fade out */
}

/* === HEADER (Glassmorphism) === */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    
    /* Glass Effect */
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: var(--glass-border);
    
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.logo { display: flex; align-items: center; gap: 10px; font-weight: bold; font-size: 1.3rem; text-shadow: 0 0 10px var(--primary); }
.logo img { width: 40px; border-radius: 50%; border: 2px solid var(--primary); }

.nav-links a {
    color: #ddd;
    text-decoration: none;
    margin: 0 15px;
    font-weight: 500;
    position: relative;
    transition: 0.3s;
}

/* Link Underline Animation */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary);
    transition: width 0.3s;
}
.nav-links a:hover::after { width: 100%; }
.nav-links a:hover { color: #fff; text-shadow: 0 0 5px var(--primary); }

.nav-auth { display: flex; align-items: center; gap: 15px; }
#user-avatar { width: 35px; border-radius: 50%; border: 2px solid var(--accent); }

/* === LAYOUT & ANIMATIONS === */
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 40px 20px;
    
    /* Fade In Effect */
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === CARDS (Glassmorphism + Hover) === */
.card, .stat-card, .server-card {
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: var(--glass-border);
    padding: 25px;
    border-radius: 15px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Hover Lift Effect */
.card:hover, .stat-card:hover, .server-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), 
                0 0 15px rgba(153, 29, 219, 0.2); /* Purple glow */
    border-color: var(--primary);
}

/* === STATS === */
.stats-row { display: flex; justify-content: center; gap: 30px; margin-top: 30px; }
.stat-card { text-align: center; min-width: 150px; }
.stat-card i { font-size: 2.5rem; color: var(--primary); margin-bottom: 15px; drop-shadow: 0 0 5px var(--primary); }
.stat-card h3 { font-size: 1.5rem; margin: 0; }
.stat-card p { color: #aaa; margin: 5px 0 0 0; }

/* === BUTTONS (Glowing) === */
button, .cta-btn, .btn-manage, .btn-invite, .btn-save {
    background: linear-gradient(45deg, var(--primary), #7a12b3);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(153, 29, 219, 0.4);
}

button:hover, .cta-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(153, 29, 219, 0.6);
}

.btn-back { background: #444; }
.btn-logout { background: transparent; box-shadow: none; font-size: 1.2rem; padding: 5px; color: #aaa; }
.btn-logout:hover { color: #ff5555; transform: scale(1.1); box-shadow: none; background: transparent; }

/* === INPUTS === */
input, select {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #444;
    color: white;
    border-radius: 8px;
    box-sizing: border-box;
    transition: 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(153, 29, 219, 0.3);
}

/* === GRIDS & HELPERS === */
.hero { text-align: center; margin-bottom: 60px; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.hero h1 { font-size: 3.5rem; margin-bottom: 10px; background: linear-gradient(to right, #fff, #aaa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.server-grid, .settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; margin-top: 20px; }
.server-icon { width: 90px; height: 90px; border-radius: 50%; margin-bottom: 15px; border: 3px solid rgba(255,255,255,0.1); }
.dash-header { display: flex; align-items: center; gap: 20px; margin-bottom: 30px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 20px; }
.full-width { grid-column: 1 / -1; }

/* Toggle Grid */
.toggle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; }
.toggle-item { 
    background: rgba(0,0,0,0.2); padding: 12px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; 
    border: 1px solid transparent; transition: 0.3s;
}
.toggle-item:hover { border-color: var(--primary); background: rgba(153, 29, 219, 0.1); }

/* === CUSTOM MODAL (Popup) === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Darkens the background */
    backdrop-filter: blur(5px);      /* Blurs the background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-box {
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(153, 29, 219, 0.3);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    width: 350px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28); /* Bouncy pop-up */
}

.modal-icon i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 10px var(--primary));
}

.modal-box h2 { margin: 0 0 10px 0; color: white; }
.modal-box p { color: #aaa; margin-bottom: 25px; }

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-login-modal {
    background: var(--primary);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
}

.btn-cancel {
    background: transparent;
    border: 1px solid #555;
    color: #ccc;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
}

.btn-cancel:hover { background: rgba(255, 255, 255, 0.1); }

@keyframes slideUp {
    from { transform: translateY(50px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* === ABOUT PAGE === */
.about-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.about-card {
    background: rgba(40, 40, 40, 0.6);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
    transition: 0.3s;
}

.about-card.interactive {
    cursor: pointer;
    border-color: var(--primary);
}

.about-card.interactive:hover {
    background: rgba(88, 101, 242, 0.2);
    transform: translateY(-5px);
}

.about-card h3 { margin: 0 0 10px 0; font-size: 1rem; color: #ccc; }
.about-card p { font-size: 2rem; margin: 0; font-weight: bold; }

/* === DEVELOPER LIST === */
.dev-section {
    background: rgba(30, 30, 30, 0.5);
    border-radius: 10px;
    padding: 10px 20px;
}

.dev-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 10px 0;
    font-size: 1.5rem;
}

.dev-list {
    margin-top: 20px;
    display: grid;
    gap: 10px;
    padding-bottom: 10px;
}

.dev-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.3);
    padding: 10px 20px;
    border-radius: 8px;
}

.dev-info { display: flex; align-items: center; gap: 15px; }
.dev-info img { width: 40px; height: 40px; border-radius: 50%; }
.dev-btn { background: #444; border: none; color: white; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; transition: 0.2s; }
.dev-btn:hover { background: var(--primary); }

/* === DISCORD PROFILE MODAL === */
.discord-profile-card {
    width: 300px;
    background: #111214;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    animation: slideUp 0.3s;
}

.profile-banner {
    height: 120px;
    background-color: var(--primary);
    background-size: cover;
    background-position: center;
}

.profile-header {
    position: relative;
    padding: 0 16px;
    margin-bottom: 10px;
}

.profile-avatar-wrapper {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: #111214;
    padding: 6px;
    margin-top: -46px;
    position: relative;
}

#prof-avatar { width: 100%; height: 100%; border-radius: 50%; }

.profile-status {
    width: 16px; height: 16px;
    background: #23a559;
    border: 3px solid #111214;
    border-radius: 50%;
    position: absolute;
    bottom: 6px; right: 6px;
}

.profile-body {
    padding: 16px;
    background: #111214;
    color: #dbdee1;
}

/* --- NEW: Name & Badge Layout --- */
.profile-name-container {
    display: flex;
    align-items: center;
    gap: 8px; /* Space between name and badge */
}

.profile-name { font-size: 20px; font-weight: 700; color: #f2f3f5; }

/* Badges now transparent and inline */
.profile-badges {
    display: flex;
    gap: 8px;
    background: transparent; /* No black box */
    padding: 0;
    align-items: center;
}

.profile-badges i { font-size: 16px; cursor: pointer; position: relative;}

.profile-username { font-size: 14px; color: #b5bac1; margin-bottom: 15px; }

.profile-divider { height: 1px; background: #2f3136; margin: 12px 0; }

.profile-section h4 {
    font-size: 11px; font-weight: 700; color: #b5bac1;
    margin-bottom: 8px; text-transform: uppercase;
}

.profile-section span { font-size: 13px; }

.profile-role {
    display: inline-flex; align-items: center; gap: 5px;
    background: #2b2d31; padding: 4px 8px; border-radius: 4px; font-size: 12px;
}
.role-dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; }

/* --- Button Update --- */
.profile-actions {
    margin-top: 20px;
    width: 100%;
}

.msg-btn {
    background: var(--primary);
    width: 100%; /* Full width */
    padding: 10px;
    border: none;
    border-radius: 3px;
    color: white;
    cursor: not-allowed;
    font-weight: bold;
}

/* === STATS LIST MODAL === */
.stats-box { width: 400px; max-height: 80vh; overflow-y: auto; text-align: left; }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #333; padding-bottom: 10px; margin-bottom: 15px; }
.btn-close-icon { background: none; color: #aaa; font-size: 1.2rem; padding: 0; box-shadow: none; width: auto; }
.btn-close-icon:hover { color: white; transform: none; box-shadow: none; }

.stats-item {
    display: flex; justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #333;
}
.stats-item:last-child { border-bottom: none; }
.stats-badge {
    background: var(--primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: bold;
}

/* === BADGE TOOLTIP STYLES === */
.profile-badges i {
    position: relative; /* Needed for positioning the tooltip */
    cursor: pointer;
}

/* The Tooltip Box (Hidden by default) */
.profile-badges i::after {
    content: attr(data-tooltip); /* Grab text from the attribute */
    position: absolute;
    bottom: 140%; /* Move above the icon */
    left: 50%;
    transform: translateX(-50%) translateY(10px) scale(0.9); /* Start slightly down and small */
    background: #000;
    color: #fff;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap; /* Prevent line breaks */
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Bouncy effect */
    pointer-events: none; /* Let clicks pass through */
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 100;
}

/* Show on Hover */
.profile-badges i:hover::after,
.profile-badges i:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* === MESSAGE BUTTON FIX === */
/* Find the existing .msg-btn rule and UPDATE the cursor */
.msg-btn {
    /* ... keep other styles ... */
    cursor: pointer !important; /* Force pointer so it looks clickable */
}

/* === CLOSING ANIMATIONS === */
/* The Overlay Fading Out */
.modal-overlay.closing {
    animation: fadeOut 0.3s ease-in forwards;
}

/* The Card Sliding Down */
.discord-profile-card.closing {
    animation: slideDown 0.3s ease-in forwards;
}

@keyframes slideDown {
    from { transform: translateY(0) scale(1); opacity: 1; }
    to { transform: translateY(50px) scale(0.9); opacity: 0; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* === SMOOTH DEVELOPER LIST ANIMATION === */

/* The Wrapper controls the height */
.dev-wrapper {
    display: grid;
    grid-template-rows: 0fr; /* Closed by default */
    transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1); /* Smooth easing */
}

/* The 'open' class expands it */
.dev-wrapper.open {
    grid-template-rows: 1fr; /* 1fr means "auto height" */
}

/* The inner list must hide overflow for animation to work */
.dev-list {
    overflow: hidden;
    min-height: 0; /* Critical fix for grid animation */
    /* Remove any display: none or grid from here! */
}

/* Rotate the arrow icon */
#dev-chevron {
    transition: transform 0.3s ease;
}

.dev-header.active #dev-chevron {
    transform: rotate(180deg);
}