@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
    --bg: #111320;
    --bg-elevated: #171a2b;
    --card: #1c1f33;
    --card-border: #2b2f47;
    --card-border-hover: #3d4266;
    --text: #f2f3f7;
    --text-muted: #9ba1af;
    --brand-a: #ff3dcb;
    --brand-b: #9b4dff;
    --brand-gradient: linear-gradient(135deg, var(--brand-a), var(--brand-b));
    --success: #3ddc97;
    --danger: #ff5470;
    --warning: #ffb020;
    --radius: 16px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, sans-serif;
    min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Manrope', 'Inter', sans-serif; font-weight: 800; margin: 0; }
a { color: inherit; }
code { background: #0d0e18; padding: 2px 6px; border-radius: 6px; font-size: 0.9em; border: 1px solid var(--card-border); }

/* ── Navbar (every page) ─────────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--card-border);
}
.navbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.navbar-brand img { width: 34px; height: 34px; border-radius: 9px; display: block; }
.navbar-brand span { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 1.15em; letter-spacing: -0.02em; }
.navbar-right { display: flex; align-items: center; gap: 14px; }
.navbar-avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--card-border); }
.navbar-link { color: var(--text-muted); text-decoration: none; font-size: 0.92em; font-weight: 500; }
.navbar-link:hover { color: var(--text); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-discord {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand-gradient);
    color: white;
    border: none;
    padding: 12px 26px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1em;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    font-family: 'Manrope', sans-serif;
}
.btn-discord:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(155, 77, 255, 0.35); opacity: 0.95; }
.btn-discord:active { transform: translateY(0); }
.btn-small { padding: 9px 18px; font-size: 0.88em; }
.btn-outline { background: transparent; border: 1.5px solid var(--card-border); color: var(--text); }
.btn-outline:hover { border-color: var(--brand-b); box-shadow: none; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { box-shadow: 0 8px 24px rgba(255, 84, 112, 0.3); }

/* ── Landing page ─────────────────────────────────────────── */
.hero {
    min-height: calc(100vh - 68px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    top: -20%; left: 50%;
    transform: translateX(-50%);
    width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(155,77,255,0.18), transparent 65%);
    pointer-events: none;
}
.hero-logo { width: 84px; height: 84px; border-radius: 22px; margin-bottom: 22px; position: relative; box-shadow: 0 0 60px rgba(255, 61, 203, 0.35); }
.hero h1 { font-size: 2.6em; letter-spacing: -0.03em; margin-bottom: 14px; position: relative; }
.hero p { color: var(--text-muted); max-width: 480px; line-height: 1.6; margin-bottom: 30px; position: relative; font-size: 1.05em; }
.button-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; position: relative; }

.feature-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; max-width: 900px; width: 100%; margin: 50px auto 0; position: relative; padding: 0 20px; }
.feature-strip .feature { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 22px; text-align: left; }
.feature-strip .feature .icon-box { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-gradient); display: flex; align-items: center; justify-content: center; font-size: 1.3em; margin-bottom: 14px; }
.feature-strip .feature h4 { font-size: 1.05em; margin-bottom: 6px; }
.feature-strip .feature p { color: var(--text-muted); font-size: 0.88em; line-height: 1.5; margin: 0; }

/* ── Server picker ────────────────────────────────────────── */
.page-header { text-align: center; padding: 40px 20px 10px; }
.page-header h2 { font-size: 1.6em; margin-bottom: 8px; }
.page-header p { color: var(--text-muted); }
.stat-pill { display: inline-block; background: var(--card); border: 1px solid var(--card-border); padding: 6px 16px; border-radius: 999px; font-size: 0.85em; color: var(--text-muted); margin: 4px; }

.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px; max-width: 900px; margin: 30px auto; padding: 0 20px; }
.server-card { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--text); text-align: center; }
.server-icon { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--card-border); transition: border-color 0.15s, transform 0.15s; margin-bottom: 10px; }
.server-card:hover .server-icon { border-color: var(--brand-b); transform: scale(1.04); box-shadow: 0 0 22px rgba(155, 77, 255, 0.3); }
.server-card h4 { font-size: 0.9em; font-weight: 600; }
.server-card-invite .server-icon { border-style: dashed; opacity: 0.5; }
.server-card-invite:hover .server-icon { opacity: 0.85; border-color: var(--warning); box-shadow: 0 0 22px rgba(255, 176, 32, 0.25); }
.invite-badge { display: block; margin-top: 4px; font-size: 0.72em; color: var(--warning); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }

.server-card-suspended .server-icon { opacity: 0.4; filter: grayscale(60%); border-color: var(--danger); }
.server-card-suspended:hover .server-icon { opacity: 0.7; box-shadow: 0 0 22px rgba(255, 84, 112, 0.25); }
.suspended-badge { display: block; margin-top: 4px; font-size: 0.72em; color: var(--danger); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }

/* ── Dashboard layout ─────────────────────────────────────── */
.page { max-width: 1000px; width: 100%; margin: 0 auto; padding: 30px 20px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.topbar h2 { flex: 1; text-align: center; font-size: 1.4em; }
.topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.back-link { color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.92em; display: inline-flex; align-items: center; gap: 4px; }
.back-link:hover { color: var(--text); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: left;
    margin-bottom: 18px;
    transition: border-color 0.15s;
}
.card:hover { border-color: var(--card-border-hover); }
.card h3 { font-size: 1.05em; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.card-desc { color: var(--text-muted); font-size: 0.88em; margin-bottom: 16px; line-height: 1.5; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.68em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-website { background: rgba(155, 77, 255, 0.15); color: #c89bff; border: 1px solid rgba(155, 77, 255, 0.3); }
.badge-automod { background: rgba(61, 220, 151, 0.15); color: #6ee8b5; border: 1px solid rgba(61, 220, 151, 0.3); }

.form-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.form-row input[type="text"], .form-row select, .form-row textarea {
    flex: 1; min-width: 160px; padding: 11px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--card-border); background: var(--bg-elevated); color: var(--text);
    font-size: 0.95em; font-family: inherit;
}
.form-row textarea { width: 100%; resize: vertical; min-height: 60px; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--brand-b); }
.status-line { min-height: 18px; font-size: 0.85em; margin-top: 4px; font-weight: 500; }

/* Quick-glance stat strip */
.stat-strip { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.stat-chip { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 10px 16px; flex: 1; min-width: 120px; text-align: center; }
.stat-chip-label { display: block; font-size: 0.72em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.stat-chip-value { display: block; font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 1.15em; }

/* Log event checkboxes */
.log-event-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.log-event-check { display: flex; align-items: center; gap: 8px; font-size: 0.9em; cursor: pointer; }
.log-event-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand-b); cursor: pointer; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background-color: #3a3f57; border-radius: 999px; transition: 0.2s; }
.toggle-slider::before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; border-radius: 50%; transition: 0.2s; }
.toggle input:checked + .toggle-slider { background: var(--brand-gradient); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Reaction-role builder / shop rows */
.pair-row { background: var(--bg-elevated); padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--card-border); }
.table-scroll { width: 100%; overflow-x: auto; }
.rr-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.rr-table th, .rr-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--card-border); word-break: break-word; overflow-wrap: anywhere; }
.rr-table th { color: var(--text-muted); font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.03em; }

/* Server search-to-suspend */
.search-results { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; max-height: 280px; overflow-y: auto; }
.search-result-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); background: var(--bg-elevated); cursor: pointer; transition: background 0.15s; }
.search-result-row:hover { background: var(--card-border); }
.search-result-icon { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.search-result-info { min-width: 0; overflow: hidden; }
.search-result-name { font-weight: 600; font-size: 0.9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selected-server { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); background: var(--bg-elevated); border: 1px solid var(--brand-b); margin-bottom: 10px; }
.selected-server-icon { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.selected-server span { flex: 1; font-weight: 600; }

/* Blockword chips */
.keyword-list { display: flex; flex-wrap: wrap; gap: 8px; }
.keyword-chip { background: var(--bg-elevated); border: 1px solid var(--card-border); padding: 7px 12px; border-radius: 999px; font-size: 0.88em; display: flex; align-items: center; gap: 8px; }
.keyword-chip button { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 0.9em; padding: 0; }
.keyword-chip button:hover { color: #ff7a94; }

/* Bot-missing state */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state h2 { margin-bottom: 12px; }
.empty-state p { color: var(--text-muted); margin-bottom: 24px; }

/* Quick Start */
.quick-start-hero { text-align: center; margin-bottom: 32px; }
.quick-start-hero h1 { font-size: 1.9em; margin-bottom: 10px; }
.quick-start-hero p { color: var(--text-muted); max-width: 560px; margin: 0 auto; line-height: 1.6; }
.quick-start-card { display: block; text-decoration: none; color: inherit; transition: transform 0.15s, border-color 0.15s; }
.quick-start-card:hover { transform: translateY(-3px); border-color: var(--brand-b); }
.quick-start-skip { text-align: center; margin-top: 25px; }

@media (max-width: 600px) {
    .page { padding: 16px; }
    .topbar { flex-direction: column; text-align: center; }
    .hero h1 { font-size: 2em; }
    .navbar { padding: 14px 18px; }
}
