/* HORIZON LABS - PREMIUM COSMIC GLASS v7.3 */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-deep: #030407;
    --bg-sidebar: rgba(10, 10, 14, 0.85);
    --bg-card: rgba(20, 22, 30, 0.6);
    
    --accent: #6366f1; /* Indigo */
    --accent-glow: rgba(99, 102, 241, 0.25);
    
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --text: #f8fafc;
    --text-muted: #94a3b8;
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --sidebar-width: 280px;
    --radius: 16px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; -webkit-font-smoothing: antialiased; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-deep);
    background-image: 
        radial-gradient(circle at 5% 10%, rgba(99, 102, 241, 0.12), transparent 40%),
        radial-gradient(circle at 95% 90%, rgba(236, 72, 153, 0.08), transparent 40%);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

/* ===== LAYOUT ===== */
.app-layout { display: flex; height: 100vh; width: 100vw; }

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-sidebar);
    backdrop-filter: blur(25px);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 24px 20px; z-index: 50;
    transition: background 0.5s ease, border-color 0.5s ease, transform 0.3s ease;
}

/* Status Gradients */
.sidebar.status-online {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.15) 0%, var(--bg-sidebar) 50%);
    border-right: 1px solid rgba(16, 185, 129, 0.2);
}

.sidebar.status-offline {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.15) 0%, var(--bg-sidebar) 50%);
    border-right: 1px solid rgba(239, 68, 68, 0.2);
}

.sidebar-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; padding: 0 4px; }
.logo-box {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--accent), #ec4899);
    border-radius: 10px;
    display: grid; place-items: center;
    font-weight: 800; color: white;
    box-shadow: 0 0 20px var(--accent-glow);
}
.brand-title { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; color: white; }

.nav-menu { flex: 1; display: flex; flex-direction: column; gap: 6px; }

.nav-btn {
    width: 100%; text-align: left;
    background: transparent; border: 1px solid transparent;
    color: var(--text-muted);
    padding: 12px 14px; border-radius: 10px;
    cursor: pointer;
    display: flex; align-items: center; gap: 12px;
    font-weight: 600; font-size: 0.9rem;
    transition: var(--transition);
}
.nav-btn:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.nav-btn.active { 
    background: rgba(99, 102, 241, 0.12); 
    border-color: rgba(99, 102, 241, 0.2);
    color: #a5b4fc; 
}
.nav-btn i { width: 18px; height: 18px; }

.sidebar-footer { padding-top: 16px; border-top: 1px solid var(--border); margin-top: auto; display:flex; flex-direction:column; gap:16px; }

.user-profile {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; background: rgba(255,255,255,0.03);
    border: 1px solid var(--border); border-radius: 12px;
}
.user-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.1); }
.user-info { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; }
.user-info b { font-size: 0.85rem; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info a { font-size: 0.75rem; color: var(--danger); text-decoration: none; opacity: 0.8; }
.user-info a:hover { opacity: 1; }

/* ===== CONTENT ===== */
.content-area {
    flex: 1; height: 100%; overflow-y: auto; padding: 40px 60px;
    background-image: linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    background-position: center top;
}

.view-header { margin-bottom: 32px; }
.view-header h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; color: white; }
.view-header p { color: var(--text-muted); font-size: 1rem; }

/* Cards & Grid */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-bottom: 32px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 24px; align-items: start; }
.settings-stack { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

.card, .stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    padding: 24px; border-radius: var(--radius);
    box-shadow: 0 8px 32px -4px rgba(0,0,0,0.3);
    transition: transform 0.2s, border-color 0.2s;
    position: relative; overflow: hidden;
}
.card:hover { border-color: var(--border-hover); transform: translateY(-2px); }

.stat-card h2 { font-size: 2.4rem; font-weight: 700; color: white; margin-top: 4px; line-height: 1; }
.stat-card span { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Inputs */
.input-box, textarea.input-box, select.input-box {
    background: rgba(0,0,0,0.3); border: 1px solid var(--border);
    border-radius: 10px; padding: 10px 14px;
    color: white; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.9rem;
    width: 100%; transition: 0.2s;
}
.input-box:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }

/* Buttons */
.btn {
    padding: 10px 18px; border-radius: 10px; border: none; cursor: pointer;
    font-weight: 600; font-size: 0.9rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: 0.2s; white-space: nowrap;
}
.btn-save { background: var(--accent); color: white; box-shadow: 0 4px 15px var(--accent-glow); }
.btn-save:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.btn-ghost { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: white; border-color: var(--border-hover); }
.btn-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }
.icon-btn-sm, .delete-btn { background:none; border:none; color:var(--text-muted); cursor:pointer; padding:6px; transition: color 0.2s; border-radius: 6px; }
.icon-btn-sm:hover, .delete-btn:hover { color:white; background: rgba(255,255,255,0.05); }

/* Settings Items */
.setting-row {
    background: rgba(0,0,0,0.2); border: 1px solid var(--border);
    padding: 12px; border-radius: 10px;
    display: flex; flex-direction: column; gap: 10px;
}
.setting-meta { display: flex; justify-content: space-between; align-items: center; }
.setting-label { font-size: 0.85rem; font-weight: 600; color: #ddd; }
.setting-id-badge { 
    font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; 
    background: rgba(255,255,255,0.05); padding: 2px 6px; border-radius: 4px; color: var(--text-muted);
}

/* ID Resolution Badges */
.resolved-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 600;
    margin-top: 6px; width: fit-content;
}
.resolved-badge.role { background: rgba(244, 114, 182, 0.15); color: #f472b6; border: 1px solid rgba(244, 114, 182, 0.2); }
.resolved-badge.channel { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.2); }
.resolved-badge.user, .resolved-badge.member { background: rgba(167, 139, 250, 0.15); color: #a78bfa; border: 1px solid rgba(167, 139, 250, 0.2); }
.resolved-badge.error { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }

/* Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .3s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); }

/* Console */
.console-wrapper { 
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; 
    background: #09090b; display: flex; flex-direction: column; margin-top: 24px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.console-header { 
    padding: 12px 20px; background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--border); 
    font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; 
    display: flex; justify-content: space-between; align-items: center;
}
.console-body { 
    height: 350px; padding: 12px 0; overflow-y: auto; color: #e6edf3; 
    font-size: 0.85rem; font-family: 'JetBrains Mono', monospace; 
}
.log-entry { 
    padding: 6px 16px; border-left: 3px solid transparent; 
    display: flex; align-items: baseline; gap: 12px; transition: background 0.1s;
}
.log-entry:hover { background: rgba(255,255,255,0.02); }
.log-badge { padding: 2px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; min-width: 50px; text-align: center; }
.log-lvl-info { background: rgba(56, 139, 253, 0.15); color: #58a6ff; border: 1px solid rgba(56, 139, 253, 0.2); }
.log-lvl-warn { background: rgba(210, 153, 34, 0.15); color: #d29922; border: 1px solid rgba(210, 153, 34, 0.2); }
.log-lvl-error { background: rgba(248, 81, 73, 0.15); color: #f85149; border: 1px solid rgba(248, 81, 73, 0.2); }
.log-ts { color: var(--text-muted); font-size: 0.75rem; }

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(10px);
    display: flex; justify-content: center; align-items: center;
    z-index: 2000; opacity: 0; visibility: hidden; transition: 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    background: #12141a; border: 1px solid var(--border);
    width: 90%; max-width: 500px; border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
    transform: scale(0.95); transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex; flex-direction: column; overflow: hidden;
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.02); }
.modal-header h3 { margin: 0; font-size: 1.1rem; font-weight: 700; color: white; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.5rem; line-height: 1; }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; background: rgba(0,0,0,0.2); }

/* Toast */
.toast {
    position: fixed; bottom: 30px; right: 30px;
    background: var(--success); color: #00331f; padding: 12px 20px; border-radius: 12px; font-weight: 700;
    transform: translateY(150px); transition: 0.4s; z-index: 3000; box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.toast.show { transform: translateY(0); }

/* Login Page (Restored Premium) */
.auth-container {
    height: 100vh; width: 100vw; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at center, #161b22 0%, #020408 100%); position: fixed; top: 0; left: 0; z-index: 200;
}
.auth-card {
    width: 100%; max-width: 400px; background: rgba(13, 17, 23, 0.7); backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1); padding: 40px; border-radius: 24px; text-align: center;
    box-shadow: 0 40px 80px -12px rgba(0, 0, 0, 0.6); position: relative; overflow: hidden;
}
.auth-card::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 60%); pointer-events: none;
}
.auth-logo {
    width: 64px; height: 64px; margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--accent), #ec4899);
    border-radius: 18px; display: grid; place-items: center;
    font-size: 2rem; font-weight: 800; color: white;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}
.btn-discord {
    background: #5865f2; color: white; width: 100%; padding: 14px;
    border-radius: 12px; border: none; font-weight: 700; font-size: 1rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: 0.2s; box-shadow: 0 8px 20px rgba(88, 101, 242, 0.25); margin-top: 32px;
}
.btn-discord:hover { background: #4752c4; transform: translateY(-2px); box-shadow: 0 12px 25px rgba(88, 101, 242, 0.4); }

/* Login Stats Grid */
.auth-stats {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
    margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1);
}
.auth-stat-item { display: flex; flex-direction: column; gap: 4px; }
.auth-stat-val { color: white; font-weight: 700; font-size: 1.1rem; line-height: 1; }
.auth-stat-label { color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; font-weight: 600; letter-spacing: 0.05em; }

/* Status Dot */
.bot-status-pill {
    position: absolute; top: 20px; right: 20px;
    background: rgba(16, 185, 129, 0.15); color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 4px 10px; border-radius: 20px;
    font-size: 0.7rem; font-weight: 700;
    display: flex; align-items: center; gap: 6px;
}
.status-dot-pulse { width: 6px; height: 6px; background: currentColor; border-radius: 50%; box-shadow: 0 0 8px currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }

/* Mobile */
@media (max-width: 768px) {
    .sidebar { position: fixed; transform: translateX(-100%); height: 100%; box-shadow: 20px 0 50px rgba(0,0,0,0.5); }
    .content-area { padding: 80px 20px; }
    .settings-grid { grid-template-columns: 1fr; }
}