/* style.css - Final Version */
:root {
    --bg-primary: #313338;
    --bg-secondary: #2b2d31;
    --bg-tertiary: #1e1f22;
    --accent: #5865F2;
    --accent-hover: #4752c4;
    --text-normal: #dbdee1;
    --text-muted: #949ba4;
    --border: #1e1f22;
    --danger: #da373c;
    --success: #23a559;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }

/* --- GLOBAL LAYOUT (Website Mode - Default) --- */
body {
    background-color: var(--bg-primary);
    color: var(--text-normal);
    min-height: 100vh;
    overflow-y: auto; /* ALLOW SCROLLING BY DEFAULT */
}

/* --- DASHBOARD LAYOUT (App Mode - No Window Scroll) --- */
body.dashboard-body {
    height: 100vh;
    overflow: hidden; /* DISABLE SCROLLING ONLY FOR DASHBOARD */
}

/* Loading Screen */
#loading-screen {
    position: fixed; inset: 0; background: var(--bg-primary);
    display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1000;
}
.spinner {
    width: 40px; height: 40px; border: 4px solid var(--bg-tertiary);
    border-top: 4px solid var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Layout Containers */
#app { display: flex; flex-direction: column; height: 100vh; }

header {
    height: 60px; background: var(--bg-secondary); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.server-icon {
    width: 32px; height: 32px; background: var(--bg-tertiary); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-weight: bold; color: var(--text-muted);
}
.badge { font-size: 10px; background: var(--accent); padding: 2px 6px; border-radius: 4px; color: white; text-transform: uppercase; font-weight: 700; margin-left: 8px;}
#server-name { font-size: 16px; font-weight: 600; }

.main-container { display: flex; flex: 1; overflow: hidden; }

/* Sidebar */
.sidebar { width: 240px; background: var(--bg-secondary); padding: 20px 10px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    padding: 10px 12px; border-radius: 4px; cursor: pointer; color: var(--text-muted); font-weight: 500; transition: 0.2s;
}
.nav-item:hover { background-color: var(--bg-tertiary); color: var(--text-normal); }
.nav-item.active { background-color: var(--bg-tertiary); color: var(--text-normal); font-weight: 600; }

/* Content */
.content { flex: 1; padding: 40px; overflow-y: auto; background: var(--bg-primary); }
h2 { margin-bottom: 24px; color: white; border-bottom: 1px solid var(--border); padding-bottom: 10px; }

/* Settings Cards */
.setting-card {
    background: var(--bg-secondary); border-radius: 8px; padding: 16px; margin-bottom: 16px;
    display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--bg-tertiary);
}
.setting-header { display: flex; justify-content: space-between; align-items: center; }
.setting-label { font-weight: 600; color: var(--text-normal); }
.setting-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }

/* Inputs */
input[type="text"], input[type="number"], select {
    background: var(--bg-tertiary); border: none; color: white; padding: 8px 12px;
    border-radius: 4px; width: 100%; outline: none; font-size: 14px;
}
input:focus, select:focus { box-shadow: 0 0 0 2px var(--accent); }

/* Toggle Switch */
.toggle-switch {
    position: relative; width: 40px; height: 24px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0; background-color: var(--bg-tertiary);
    transition: .4s; border-radius: 24px;
}
.slider:before {
    position: absolute; content: ""; height: 16px; width: 16px; left: 4px; bottom: 4px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(16px); }

/* Tag Input (Lists) */
.tag-container {
    background: var(--bg-tertiary); padding: 8px; border-radius: 4px; min-height: 40px;
    display: flex; flex-wrap: wrap; gap: 6px;
}
.tag {
    background: var(--bg-primary); color: var(--text-normal); padding: 4px 8px; border-radius: 4px;
    font-size: 12px; display: flex; align-items: center; gap: 6px;
}
.tag span.remove { cursor: pointer; color: var(--danger); font-weight: bold; }
.tag-select { margin-top: 8px; }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 2000;
    display: flex; align-items: center; justify-content: center;
}
.modal { background: var(--bg-secondary); width: 500px; border-radius: 8px; overflow: hidden; }
.modal-header {
    padding: 16px; background: var(--bg-tertiary); display: flex; justify-content: space-between; align-items: center;
}
.close-btn { background: none; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; }
.modal-body { padding: 20px; }
.code-box {
    background: var(--bg-tertiary); padding: 12px; border-radius: 4px;
    display: flex; justify-content: space-between; align-items: center; margin: 12px 0;
}
code { color: var(--accent); font-family: monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 380px; display: block; }
.copy-btn { background: none; border: none; color: white; cursor: pointer; }

/* Buttons */
.btn { border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; text-decoration: none;}
.btn-primary { background-color: var(--accent); color: white; transition: 0.2s; }
.btn-primary:hover { background-color: var(--accent-hover); }

/* --- HOMEPAGE & COMMANDS STYLES --- */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 40px; background: rgba(43, 45, 49, 0.9); backdrop-filter: blur(10px);
    position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--border);
}
.nav-links { display: flex; gap: 24px; }
.nav-link { color: var(--text-muted); text-decoration: none; font-weight: 500; transition: 0.2s; }
.nav-link:hover { color: white; }

.hero {
    text-align: center; padding: 100px 20px;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}
.hero h1 { font-size: 48px; margin-bottom: 16px; background: linear-gradient(90deg, #fff, var(--text-muted)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 18px; color: var(--text-muted); max-width: 600px; margin: 0 auto 32px; line-height: 1.6; }

.features-section { padding: 60px 40px; max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: 40px; font-size: 28px; color: white; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

.feature-card {
    background: var(--bg-secondary); border: 1px solid var(--border);
    padding: 24px; border-radius: 12px; transition: 0.3s;
    display: flex; flex-direction: column; gap: 12px;
}
.feature-card:hover { transform: translateY(-5px); border-color: var(--accent); }
.feature-icon {
    width: 48px; height: 48px; background: var(--bg-tertiary);
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: var(--accent); margin-bottom: 8px;
}
.feature-card h3 { color: white; font-size: 18px; }
.feature-card p { color: var(--text-muted); font-size: 14px; line-height: 1.5; }

footer {
    text-align: center; padding: 40px; border-top: 1px solid var(--border);
    color: var(--text-muted); font-size: 14px; margin-top: auto;
}

.btn-large { padding: 12px 28px; font-size: 16px; border-radius: 8px; text-decoration: none; }
.btn-secondary { background: var(--bg-tertiary); color: white; }
.btn-secondary:hover { background: #3f4147; }