/* ==========================================================================
   1. GLOBAL VARIABLES & BASE RESETS
   ========================================================================== */
:root {
    --bg-color: #36393f;
    --card-bg: #2f3136;
    --card-hover: #40444b;
    --text-main: #dcddde;
    --text-header: #ffffff;
    --discord-blurple: #5865F2;
    --discord-blurple-hover: #4752C4;
    --danger: #ed4245;
    --tgblue: #229ED9;
    --darker: #111214;
}

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

body, html {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--darker);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    width: 100%;
}

/* ==========================================================================
   2. SHARED UI COMPONENTS (Buttons, Inputs, Navbar)
   ========================================================================== */
h1, h2, h3 { color: var(--text-header); }

.btn { 
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background-color: var(--discord-blurple); color: #fff; 
    padding: 10px 24px; border-radius: 4px; text-decoration: none; 
    font-weight: 600; border: none; cursor: pointer; transition: background-color 0.2s ease; 
}
.btn:hover { background-color: var(--discord-blurple-hover); }
.btn-danger { background-color: var(--danger); padding: 8px 16px; font-size: 0.9rem; }
.btn-danger:hover { background-color: #c03537; }

.form-group { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.form-group label { font-size: 0.9rem; font-weight: 600; color: #a3a6aa; }
.form-control {
    width: 100%; padding: 12px 16px; font-size: 1rem; font-family: inherit; color: white;
    background: rgba(17, 18, 20, 0.8); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; 
    transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--discord-blurple); }

/* Sticky Glassmorphism Navbar */
.navbar {
    position: sticky; top: 1rem; z-index: 9999;
    max-width: 1200px; width: 90%; margin: 1rem auto 2rem auto;
    background: rgba(30, 31, 34, 0.6); backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 0.75rem 1.5rem;
    display: flex; justify-content: space-between; align-items: center;
    transition: transform 0.3s ease-in-out; 
}
.navbar.nav-hidden { transform: translateY(-150%); }
.nav-brand { flex: 1; display: flex; justify-content: flex-start; }
.nav-actions { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 1rem; }
.nav-brand a { color: white; text-decoration: none; display: flex; align-items: center; gap: 12px; font-size: 1.25rem; font-weight: 700; }
.nav-brand img { width: 32px; height: 32px; border-radius: 50%; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a:not(.btn) { color: #a3a6aa; text-decoration: none; font-weight: 600; transition: color 0.2s; }
.nav-links a:not(.btn):hover { color: white; }

/* Display Utilities */
.hamburger { display: none; cursor: pointer; color: white; }
.mobile-only { display: none; }


/* ==========================================================================
   3. FRONTEND - PC / DESKTOP
   ========================================================================== */
.container { width: 100%; max-width: 1000px; margin: 0 auto; padding: 2rem; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); }

/* Ambient Glows */
.ambient-glow { position: absolute; border-radius: 50%; filter: blur(120px); pointer-events: none; z-index: 0; }
.glow-blurple { top: -10%; left: -5%; width: 500px; height: 500px; background: rgba(88, 101, 242, 0.2); }
.glow-tgblue { top: 20%; right: -5%; width: 500px; height: 500px; background: rgba(34, 158, 217, 0.2); }

/* Hero Section */
.hero { position: relative; z-index: 10; text-align: center; padding: 6rem 1rem 4rem; max-width: 1000px; margin: 0 auto; }
.hero-logo-container { position: relative; display: inline-block; margin-bottom: 1.5rem; }
.hero-logo-glow { position: absolute; inset: 0; background: var(--discord-blurple); border-radius: 50%; filter: blur(20px); opacity: 0.5; transition: opacity 0.3s; }
.hero-logo-container:hover .hero-logo-glow { opacity: 0.75; }
.hero-logo { position: relative; width: 112px; height: 112px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.1); box-shadow: 0 10px 25px rgba(0,0,0,0.5); z-index: 2; }
.hero h1 { font-size: 4rem; font-weight: 800; margin-bottom: 1rem; letter-spacing: -1px; }
.hero p.subtitle { font-size: 1.25rem; color: #a3a6aa; margin-bottom: 3rem; max-width: 700px; margin-left: auto; margin-right: auto; }

.hero-btn { display: inline-flex; align-items: center; gap: 10px; background: var(--discord-blurple); color: white; padding: 1rem 2rem; font-size: 1.1rem; font-weight: bold; border-radius: 12px; text-decoration: none; transition: transform 0.2s; box-shadow: 0 10px 20px rgba(88, 101, 242, 0.3); }
.hero-btn:hover { transform: scale(1.05); background: var(--discord-blurple-hover); }
.hero-buttons { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }
.hero-btn-topgg { background: #ff3366; box-shadow: 0 10px 20px rgba(255, 51, 102, 0.2); }
.hero-btn-topgg:hover { background: #e62e5c; }
.hero-btn-support { background: rgba(255, 255, 255, 0.1); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.05); }
.hero-btn-support:hover { background: rgba(255, 255, 255, 0.15); }

/* Grids & Cards */
.stats-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; max-width: 900px; margin: 0 auto 5rem; position: relative; z-index: 10; }
.stat-box { background: rgba(30, 31, 34, 0.8); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.05); padding: 2rem; border-radius: 16px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.3); transition: transform 0.2s; }
.stat-box:hover { transform: translateY(-5px); }
.stat-box h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 0.5rem; }
.stat-box .num { font-size: 3.5rem; font-weight: 900; line-height: 1; }

.commands-section { max-width: 1000px; margin: 0 auto 5rem; position: relative; z-index: 10; padding: 0 2rem; }
.commands-section h2 { text-align: center; font-size: 2.5rem; margin-bottom: 2.5rem; }
.commands-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.cmd-card { background: rgba(17, 18, 20, 0.6); border: 1px solid rgba(255,255,255,0.05); padding: 1.5rem; border-radius: 12px; transition: border-color 0.2s; }
.cmd-card:hover { border-color: rgba(255,255,255,0.2); }
.cmd-name { display: block; color: var(--discord-blurple); font-family: monospace; font-weight: bold; font-size: 1.2rem; margin-bottom: 0.5rem; }
.cmd-desc { color: #a3a6aa; font-size: 0.9rem; line-height: 1.5; }

/* Misc Frontend */
.text-blurple { color: var(--discord-blurple); }
.text-tgblue { color: var(--tgblue); }
.text-green { color: #4ade80; }
.feature-tag { flex: 1 1 auto; text-align: center; white-space: nowrap; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); padding: 10px 16px; border-radius: 20px; font-size: 0.95rem; color: #dcddde; transition: background 0.2s, border-color 0.2s; }
.feature-tag:hover { background: rgba(88, 101, 242, 0.1); border-color: rgba(88, 101, 242, 0.5); }

/* --- Homepage Specific: Developer Profile --- */
.dev-profile-container { max-width: 400px; margin: 0 auto 5rem; position: relative; z-index: 10; padding: 0 1rem; }
.dev-card { display: flex; align-items: center; gap: 1.5rem; background: rgba(30, 31, 34, 0.8); backdrop-filter: blur(10px); padding: 1.5rem; border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); text-decoration: none; transition: transform 0.2s; }
.dev-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,0.2); }
.avatar-wrapper { position: relative; }
.dev-avatar { width: 64px; height: 64px; border-radius: 50%; border: 2px solid #2f3136; }
.dev-decoration { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 80px; height: 80px; pointer-events: none; z-index: 10; max-width: none; }
.status-dot { position: absolute; bottom: 0; right: 0; width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--darker); z-index: 20; background: #747f8d; }
.status-online { background: #3ba55c; }
.status-idle { background: #faa61a; }
.status-dnd { background: #ed4245; }
.dev-info h4 { color: #a3a6aa; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.2rem; margin-top: 0; }
.dev-info p { color: white; font-size: 1.25rem; font-weight: bold; margin: 0; transition: color 0.2s; }
.dev-card:hover .dev-info p { color: var(--discord-blurple); }


/* ==========================================================================
   4. FRONTEND - MOBILE
   ========================================================================== */
@media (max-width: 768px) {
    .hamburger { display: block; }
    .desktop-only { display: none; }
    .mobile-only { display: inline-flex; justify-content: center; width: 100%; margin-top: 1rem; }
    
    .nav-links {
        position: absolute; top: 100%; left: 0; right: 0;
        background: rgba(30, 31, 34, 0.95); backdrop-filter: blur(15px);
        border: 1px solid rgba(255,255,255,0.05); border-radius: 12px;
        margin-top: 0.5rem; flex-direction: column; padding: 1.5rem; gap: 1.5rem;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.3s ease;
    }
    .nav-links.active { opacity: 1; visibility: visible; transform: translateY(0); }
    .hero h1 { font-size: 2.8rem; }
}


/* ==========================================================================
   5. BACKEND (ADMIN) - PC / DESKTOP
   ========================================================================== */
.dashboard-wrapper { display: flex; min-height: 100vh; background: var(--darker); }

.sidebar {
    width: 280px; background: rgba(30, 31, 34, 0.95); border-right: 1px solid rgba(255,255,255,0.05);
    display: flex; flex-direction: column; padding: 2rem 1.5rem; position: sticky; top: 0; height: 100vh; align-self: flex-start;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; font-weight: 800; color: white; margin-bottom: 3rem; text-decoration: none; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.sidebar-link { display: flex; align-items: center; gap: 12px; color: #a3a6aa; text-decoration: none; padding: 12px 16px; border-radius: 8px; transition: all 0.2s; font-weight: 500; }
.sidebar-link:hover, .sidebar-link.active { background: rgba(255,255,255,0.05); color: white; }
.sidebar-link svg { width: 18px; height: 18px; opacity: 0.7; }
.sidebar-link:hover svg, .sidebar-link.active svg { opacity: 1; color: var(--discord-blurple); }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.05); padding-top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

.main-content { flex: 1; padding: 3rem; max-width: 1200px; width: 100%; }
.dash-header { margin-bottom: 3rem; }
.dash-header h1 { font-size: 2.5rem; margin-bottom: 0.25rem; font-weight: 800; }
.dash-header p { color: #a3a6aa; font-size: 1.1rem; }
.dash-section { background: rgba(30, 31, 34, 0.6); border: 1px solid rgba(255,255,255,0.05); border-radius: 16px; padding: 2rem; margin-bottom: 3rem; }
.dash-section h2 { font-size: 1.25rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 1rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; }
.stat-card { background: rgba(17, 18, 20, 0.6); border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; padding: 1.5rem; text-align: center; transition: transform 0.2s; }
.stat-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.15); }
.stat-card h4 { font-size: 0.8rem; color: #a3a6aa; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.75rem; }
.stat-card .value { font-size: 2rem; font-weight: 800; color: var(--discord-blurple); line-height: 1; }

/* Mobile Menu Elements (Hidden on Desktop) */
.mobile-toggle { display: none; }
.sidebar-overlay { display: none; }


/* ==========================================================================
   6. BACKEND (ADMIN) - MOBILE
   ========================================================================== */
@media (max-width: 850px) {
    /* Floating Action Button (Hamburger) */
    .mobile-toggle {
        display: flex; background: var(--discord-blurple); color: white; border: none;
        width: 56px; height: 56px; border-radius: 50%; cursor: pointer;
        position: fixed; bottom: 20px; right: 20px; z-index: 1000;
        box-shadow: 0 4px 15px rgba(0,0,0,0.4); align-items: center; justify-content: center;
    }
    .mobile-toggle:hover { background: var(--discord-blurple-hover); transform: scale(1.05); }

    /* Sidebar Slide-Out Logic */
    .sidebar-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.6); backdrop-filter: blur(3px); z-index: 998; }
    .sidebar-overlay.active { display: block; }
    
    .sidebar {
        position: fixed; top: 0; left: -300px; width: 260px; height: 100vh;
        z-index: 999; transition: left 0.3s ease-in-out; box-shadow: 5px 0 25px rgba(0,0,0,0.5);
    }
    .sidebar.active { left: 0; }

    /* Fixing the Oversized Content Area */
    .main-content {
        padding: 25px 15px 90px 15px !important; 
        width: 100% !important;
        max-width: 100vw !important;
        margin: 0 !important;
    }
    
    .dash-section {
        padding: 1.25rem !important; 
    }

    /* Force all inline grids/flexboxes to stack vertically */
    .main-content div[style*="grid-template-columns"],
    .main-content form[style*="grid-template-columns"],
    .main-content div[style*="display: flex"],
    .main-content form[style*="display: flex"] {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 15px !important;
    }

    /* Keep inputs inside the screen (EXCLUDE Editor Toolbar & Table Buttons) */
    .main-content input, 
    .main-content select, 
    .main-content textarea, 
    .main-content button:not(.mobile-toggle):not(.editor-toolbar button):not(td button) {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Fix Admin Tables & Prevent Action Buttons from stretching */
    .main-content table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    /* High specificity to ensure forms and buttons inside tables don't stretch */
    .main-content td form {
        display: inline-block !important;
        width: auto !important;
        margin: 0 !important;
    }
    .main-content td button {
        width: auto !important;
        display: inline-block !important;
    }
}

/* ==========================================================================
   7. THIRD-PARTY OVERRIDES (EasyMDE)
   ========================================================================== */
.editor-toolbar { border-color: rgba(255,255,255,0.1); background: rgba(0,0,0,0.2); }
.editor-toolbar button { color: #a3a6aa !important; }
.editor-toolbar button.active, .editor-toolbar button:hover { background: rgba(255,255,255,0.1); border-color: transparent; }
.CodeMirror { background: rgba(0,0,0,0.2) !important; color: white !important; border-color: rgba(255,255,255,0.1) !important; border-radius: 0 0 8px 8px; }
.editor-preview { background: #1e1f22 !important; color: #dcddde !important; }