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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #07081D;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    position: relative;
}

/* User box on header right - keep original but hide from header (we use topbar-user) */
.user-box {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(-12px, -50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: #080E2E;
    border: 1px solid #2f3240;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: default;
    min-width: 160px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

/* New compact topbar user (placed at top-right of topbar) */
.topbar-user {
    margin-left: auto;
    display:flex;
    align-items:center;
    gap:10px;
    background: #080E2E;
    border: 1px solid #2f3240;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    min-width: 140px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.topbar-user .user-avatar {
    width:32px;
    height:32px;
    border-radius:50%;
    overflow:hidden;
    background:#151823;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
}

.topbar-user img { width:100%; height:100%; object-fit:cover; display:block; }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #151823;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.user-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-role {
    color: #b5bac1;
    font-size: 0.78rem;
}

/* Responsive: move user-box inside stacked header on small screens */
@media (max-width: 600px) {
    .user-box {
        position: static;
        transform: none;
        margin-top: 6px;
        min-width: auto;
    }
    .header-content { flex-direction: column; gap: 12px; }
}

.bot-icon {
    width: 120px;
    height: 120px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bot-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.header-text {
    text-align: left;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #ffffff;
    background: none;
    -webkit-text-fill-color: initial;
}

header p {
    color: #b5bac1;
    font-size: 1.1rem;
}

main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.card {
    background: #7D4FFF;
    border-radius: 8px;
    padding: 30px;
    border: none;
    box-shadow: none;
}

.invite-section {
    text-align: center;
}

.invite-section h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #ffffff;
}

.invite-section p {
    color: #b5bac1;
    margin-bottom: 25px;
    font-size: 1.1rem;
}

.server-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #ffffff;
}

.server-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.server-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #080E2E;
    border-radius: 12px;
    transition: background 0.3s ease;
}

.server-item:hover {
    background: #35363c;
}

.server-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #5865f2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.server-info {
    flex: 1;
}

.server-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #ffffff;
}

.server-info p {
    color: #b5bac1;
    font-size: 0.9rem;
}

/* Hamburger Menu styling kept but adjust positioning for topbar */
.hamburger-menu {
    width: 44px;
    height: 44px;
    background: #313338;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    z-index: 1000;
    transition: background-color 0.3s ease;
    margin-right: 12px;
    flex-shrink:0;
    flex-direction: column;
    padding: 8px 0;
}

.topbar .hamburger-menu {
    margin-left: 6px;
    margin-right: 12px;
}

.hamburger-menu:hover {
    background: #3a3b40;
}

.hamburger-menu span {
    display: block; /* ensure each span is a block so they stack reliably */
    width: 18px;
    height: 2px;
    background: #ffffff;
    border-radius: 1px;
    transition: all 0.3s ease;
    margin: 2px 0;
}

.hamburger-menu span + span {
    margin-top: 0;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Dropdown Menu */
.dropdown-menu {
    position: fixed;
    top: 70px;
    left: 20px;
    background: #080E2E;
    border-radius: 12px;
    padding: 10px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu ul {
    list-style: none;
}

.dropdown-menu li {
    margin: 5px 0;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
}

.dropdown-menu a:hover {
    background: #7D4FFF;
}

.dropdown-menu i {
    width: 16px;
    text-align: center;
}

/* Button with icon */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #855DFF;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    transform: none;
    box-shadow: none;
    background-color: #4752c4;
}

/* New gradient upload button variant */
.btn-upload {
    background: linear-gradient(135deg,#7D4FFF 0%, #B87CFF 50%, #6A4BFF 100%);
    box-shadow: 0 6px 18px rgba(125,79,255,0.18);
}
.btn-upload:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
}

/* Decorative round file picker button + status */
.file-picker-button {
    width:56px;
    height:56px;
    border-radius:50%;
    background: linear-gradient(135deg,#7D4FFF 0%, #B87CFF 50%, #6A4BFF 100%);
    border: none;
    display:inline-grid;
    place-items:center;
    color: #fff;
    font-size:1.05rem;
    box-shadow: 0 8px 20px rgba(125,79,255,0.18);
    cursor:pointer;
}
.file-picker-button i { font-size:1.1rem; }
.file-picker-button:active { transform: translateY(1px); }

/* file selected text removed */

/* Editor modal for create/edit */
.file-editor-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    background: rgba(0,0,0,0.6);
}
.file-editor-modal.active { display: flex; }

.file-editor {
    width: 92%;
    max-width: 900px;
    background: #0b0f28;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
    color: #ffffff;
}

.file-editor header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
}

.file-editor input.filename {
    background:#080E2E;
    border:1px solid #35363c;
    color:#fff;
    padding:8px 10px;
    border-radius:6px;
    width:60%;
}

.file-editor textarea {
    width:100%;
    height: 52vh;
    max-height: 600px;
    background:#071027;
    border:1px solid #2f3240;
    color:#e6e6e6;
    padding:12px;
    border-radius:6px;
    font-family: monospace;
    font-size: 0.95rem;
    resize: vertical;
}

.file-editor .editor-actions {
    display:flex;
    gap:10px;
    margin-top:10px;
    justify-content:flex-end;
}

/* Small responsive tweak */
@media (max-width:600px){
    .file-editor textarea { height: 38vh; }
}

.btn-secondary {
    background: #313338;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background: #3a3b40;
    border-color: transparent;
}

/* Settings page styles */
.setting-item, .permission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #35363c;
}

.setting-item:last-child, .permission-item:last-child {
    border-bottom: none;
}

.setting-info h3, .permission-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #ffffff;
}

.setting-info p, .permission-info p {
    color: #b5bac1;
    font-size: 0.9rem;
}

.setting-input {
    background: #080E2E;
    border: 1px solid #35363c;
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 1rem;
    width: 200px;
}

.setting-input:focus {
    outline: none;
    border-color: #5865f2;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #35363c;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #5865f2;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Statistics page styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: #080E2E;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: #5865f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 0.9rem;
    color: #b5bac1;
    margin-bottom: 5px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
}

.command-list {
    margin-top: 20px;
}

.command-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #080E2E;
    border-radius: 8px;
    margin-bottom: 10px;
}

.command-info h3 {
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 5px;
}

.command-info p {
    color: #b5bac1;
    font-size: 0.9rem;
}

.command-uses span {
    background: #5865f2;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Help page styles */
.faq-list {
    margin-top: 20px;
}

.faq-item {
    background: #080E2E;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background: #35363c;
}

.faq-question h3 {
    font-size: 1.1rem;
    color: #ffffff;
}

.faq-question i {
    color: #b5bac1;
    transition: transform 0.3s ease;
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer p {
    color: #dcddde;
    line-height: 1.6;
    margin-bottom: 20px;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding: 0 20px 20px;
}

.support-section {
    margin-top: 20px;
}

.support-section p {
    color: #b5bac1;
    margin-bottom: 20px;
}

.support-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.support-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #080E2E;
    border-radius: 8px;
}

.support-option i {
    font-size: 1.5rem;
    color: #5865f2;
}

.support-option h3 {
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 5px;
}

.support-option p {
    color: #b5bac1;
    font-size: 0.9rem;
}

/* Update header title color */
.header-text h1 {
    color: #ffffff;
}

/* Update card titles */
.card h2 {
    color: #ffffff;
    margin-bottom: 20px;
}

/* New: hide topbar user (we moved the user box into the header) */
.topbar .topbar-user {
    display: flex; /* show topbar user (was hidden) */
    margin-left: auto;
    align-items: center;
}

/* User-box is already styled; ensure it sits inside header-content on the right */
.user-box {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(-12px, -50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: #080E2E;
    border: 1px solid #2f3240;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: default;
    min-width: 160px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

/* Ensure header container is positioned to allow absolute positioning inside it */
.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    position: relative;
}

/* New translucent fixed top bar */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    z-index: 1500;
    background: rgba(11, 15, 40, 0.55); /* translucent dark */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: #ffffff;
}

/* Center the title in topbar */
.topbar .topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    margin: 0 auto;
    text-align: center;
}

/* Ensure main container is pushed below the fixed topbar */
body {
    padding-top: 92px; /* provide space for fixed topbar + some breathing room */
}

/* Make small-screen topbar a bit taller */
@media (max-width: 600px) {
    .topbar { height: 72px; padding: 0 14px; }
    body { padding-top: 104px; }
    .topbar .topbar-title { margin: 0 auto; }
    .topbar-user { display:none; } /* hide topbar user on very small screens to keep layout simple */
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-text {
        text-align: center;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .server-item {
        flex-wrap: wrap;
    }
    
    .btn-secondary {
        width: 100%;
        margin-top: 10px;
    }
    
    .setting-item, .permission-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .setting-input {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .command-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .command-uses {
        align-self: flex-end;
    }
}

/* toolbar round upload button (matches file-picker style but smaller) */
.toolbar-upload-button {
    width:44px;
    height:44px;
    border-radius:50%;
    background: linear-gradient(135deg,#7D4FFF 0%, #B87CFF 50%, #6A4BFF 100%);
    border: none;
    display:inline-grid;
    place-items:center;
    color: #fff;
    font-size:1.05rem;
    box-shadow: 0 6px 16px rgba(125,79,255,0.14);
    cursor:pointer;
}
.toolbar-upload-button i { font-size:1rem; }