/* SkyForge Hosting Panel — style.css */

/* ─── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg-0:      #0a0c12;
  --bg-1:      #10131d;
  --bg-2:      #161a27;
  --bg-3:      #1c2133;
  --glass-bg:  rgba(255,255,255,.045);
  --glass-bdr: rgba(255,255,255,.08);
  --ink-0:     #f0f2fa;
  --ink-1:     #9aa3bf;
  --ink-2:     #5a6380;
  --accent:    #4f8ef7;
  --accent-2:  #7b5ef7;
  --success:   #22c55e;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --running:   #22c55e;
  --stopped:   #ef4444;
  --starting:  #f59e0b;
  --stopping:  #f59e0b;
  --r:         10px;
  --r-lg:      16px;
  --shadow:    0 4px 32px rgba(0,0,0,.45);
}
html, body { height: 100%; }
body {
  font-family: 'Manrope', system-ui, sans-serif;
  background: var(--bg-0);
  color: var(--ink-0);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; cursor: pointer; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; }
.hidden { display: none !important; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* ─── Background stage ─────────────────────────────────────── */
.bg-stage {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(79,142,247,.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 110%, rgba(123,94,247,.14) 0%, transparent 60%),
    var(--bg-0);
}
.grid-overlay {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black, transparent);
}

/* ─── Glass utility ────────────────────────────────────────── */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-bdr);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.glass-strong {
  background: rgba(22,26,39,.82);
  border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* ─── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--r);
  font-size: 13.5px; font-weight: 600;
  transition: background .15s, opacity .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff; box-shadow: 0 2px 12px rgba(79,142,247,.35);
}
.btn.primary:hover { opacity: .9; }
.btn.ghost {
  background: var(--glass-bg); border: 1px solid var(--glass-bdr); color: var(--ink-1);
}
.btn.ghost:hover { background: rgba(255,255,255,.08); color: var(--ink-0); }
.btn.danger { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.btn.danger:hover { background: rgba(239,68,68,.25); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ─── Form elements ────────────────────────────────────────── */
.input {
  width: 100%; padding: 11px 14px; border-radius: var(--r);
  background: rgba(255,255,255,.05); border: 1px solid var(--glass-bdr);
  color: var(--ink-0); font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,142,247,.15); }
.input::placeholder { color: var(--ink-2); }
.label { font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.form-row { margin-bottom: 16px; }
.err {
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.25);
  color: #fca5a5; padding: 10px 14px; border-radius: var(--r); font-size: 13px; margin-top: 12px;
}

/* ─── Brand ────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 14px rgba(79,142,247,.35);
}
.brand-text { display: flex; flex-direction: column; }
.brand-text .name { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 15px; line-height: 1.2; }
.brand-text .tag { font-size: 10.5px; color: var(--ink-2); font-weight: 500; letter-spacing: .04em; }

/* ─── Login ────────────────────────────────────────────────── */
.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 420px; padding: 36px 32px; border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.login-card .brand { margin-bottom: 28px; }
.login-title { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-sub { color: var(--ink-1); font-size: 13.5px; margin-bottom: 22px; }
.login-sub .mono { color: var(--accent); }
.helper {
  margin-top: 20px; padding: 12px 14px; border-radius: var(--r);
  background: rgba(79,142,247,.08); border: 1px solid rgba(79,142,247,.15);
  color: var(--ink-1); font-size: 12.5px; line-height: 1.6;
}

/* ─── App layout ───────────────────────────────────────────── */
.app { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: 220px; flex-shrink: 0; display: flex; flex-direction: column;
  padding: 20px 14px; border-right: 1px solid var(--glass-bdr);
  overflow-y: auto;
}
.nav-section { font-size: 10.5px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; margin: 12px 4px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px;
  border-radius: var(--r); color: var(--ink-1); font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: background .12s, color .12s;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: var(--ink-0); }
.nav-item.active { background: rgba(79,142,247,.12); color: var(--accent); }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--glass-bdr); }
.acct { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
}
.acct-info { overflow: hidden; }
.acct-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-email { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Main */
.main { flex: 1; overflow-y: auto; padding: 28px 32px; }

/* ─── Page head ────────────────────────────────────────────── */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-head h1 { font-family: 'Sora', sans-serif; font-size: 24px; font-weight: 700; line-height: 1.2; }
.crumb { font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
.crumb a { color: var(--accent); cursor: pointer; }
.crumb a:hover { text-decoration: underline; }

/* ─── Status pill ──────────────────────────────────────────── */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.06); color: var(--ink-1); border: 1px solid var(--glass-bdr);
  text-transform: capitalize;
}
.status-pill .dot {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0;
}
.status-pill.running  { color: var(--running);  background: rgba(34,197,94,.1);  border-color: rgba(34,197,94,.25); }
.status-pill.stopped  { color: var(--stopped);  background: rgba(239,68,68,.1);  border-color: rgba(239,68,68,.25); }
.status-pill.starting { color: var(--starting); background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.25); }
.status-pill.stopping { color: var(--stopping); background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.25); }

/* ─── Server grid ──────────────────────────────────────────── */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.server-card {
  padding: 20px; border-radius: var(--r-lg); cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.server-card:hover { border-color: rgba(79,142,247,.3); box-shadow: 0 4px 24px rgba(79,142,247,.1); transform: translateY(-1px); }
.sc-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 10px; }
.sc-name { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 15px; }
.sc-id { font-size: 11px; color: var(--ink-2); margin-top: 3px; }
.sc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sc-meta > div { display: flex; flex-direction: column; font-size: 12px; color: var(--ink-2); }
.sc-meta strong { font-size: 13px; color: var(--ink-0); font-weight: 600; margin-top: 1px; }

/* ─── Tabs ─────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 1px solid var(--glass-bdr); padding-bottom: 0;
}
.tab {
  padding: 9px 18px; font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  border-radius: var(--r) var(--r) 0 0; position: relative;
  transition: color .12s; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink-0); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ─── Stat cards ───────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { padding: 18px 20px; border-radius: var(--r-lg); }
.stat-value { font-family: 'Sora', sans-serif; font-size: 28px; font-weight: 700; }
.stat-unit { font-size: 13px; color: var(--ink-2); margin-left: 4px; }
.stat-bar { height: 4px; background: rgba(255,255,255,.08); border-radius: 2px; margin: 10px 0 6px; overflow: hidden; }
.stat-bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 2px; transition: width .4s ease; }
.stat-sub { font-size: 11.5px; color: var(--ink-2); }

/* ─── Section cards / panel row ────────────────────────────── */
.section-card { padding: 22px 24px; border-radius: var(--r-lg); }
.section-card h3 { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.panel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .panel-row { grid-template-columns: 1fr; } }

/* ─── Power buttons ────────────────────────────────────────── */
.power-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.power-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 16px 10px; border-radius: var(--r);
  font-size: 12.5px; font-weight: 600; transition: background .12s, transform .1s;
  border: 1px solid var(--glass-bdr); color: var(--ink-1);
  background: var(--glass-bg);
}
.power-btn:hover { background: rgba(255,255,255,.08); color: var(--ink-0); transform: translateY(-1px); }
.power-btn:active { transform: scale(.97); }
.power-btn.start  { color: var(--success); border-color: rgba(34,197,94,.25); }
.power-btn.start:hover { background: rgba(34,197,94,.1); }
.power-btn.restart { color: var(--accent); border-color: rgba(79,142,247,.25); }
.power-btn.restart:hover { background: rgba(79,142,247,.1); }
.power-btn.stop   { color: var(--warning); border-color: rgba(245,158,11,.25); }
.power-btn.stop:hover { background: rgba(245,158,11,.1); }
.power-btn.kill   { color: var(--danger); border-color: rgba(239,68,68,.25); }
.power-btn.kill:hover { background: rgba(239,68,68,.1); }

/* ─── Console ──────────────────────────────────────────────── */
.console {
  background: rgba(0,0,0,.45); border-radius: var(--r); padding: 14px 16px;
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px; line-height: 1.7;
  height: 340px; overflow-y: auto; margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,.06);
}
.console-line { color: var(--ink-1); word-break: break-all; }
.console-line.sys { color: var(--accent); }
.console-line.err { color: #fca5a5; }
.cmd-row { display: flex; gap: 10px; }
.cmd-input { flex: 1; }

/* ─── File manager ─────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--glass-bdr); border-radius: var(--r-lg);
  padding: 24px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s; margin-bottom: 14px;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: rgba(79,142,247,.06); }
.upload-zone-text { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.upload-zone-sub { font-size: 12px; color: var(--ink-2); }
.file-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  padding: 8px 12px; background: rgba(0,0,0,.2); border-radius: var(--r);
  border: 1px solid var(--glass-bdr);
}
.path-bar { flex: 1; font-size: 12.5px; color: var(--ink-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list { border: 1px solid var(--glass-bdr); border-radius: var(--r); overflow: hidden; }
.file-row {
  display: grid; grid-template-columns: 20px 1fr 80px 120px auto;
  align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.04); transition: background .1s;
  cursor: pointer;
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: rgba(255,255,255,.04); }
.fname { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsize, .fmod { font-size: 12px; color: var(--ink-2); }
.factions { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px; color: var(--ink-2);
  transition: background .1s, color .1s;
}
.icon-btn:hover { background: rgba(255,255,255,.1); color: var(--ink-0); }
.icon-btn.danger:hover { background: rgba(239,68,68,.15); color: #fca5a5; }

/* ─── Modals ───────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}
.modal {
  width: 100%; max-width: 420px; padding: 28px; border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.modal p { color: var(--ink-1); font-size: 13.5px; margin-bottom: 20px; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.pw-display {
  font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 600;
  text-align: center; padding: 16px; border-radius: var(--r);
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.12);
  color: var(--accent); letter-spacing: .06em; margin-bottom: 12px;
  word-break: break-all;
}

/* ─── Toasts ───────────────────────────────────────────────── */
#toasts {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  padding: 12px 18px; border-radius: var(--r); font-size: 13.5px; font-weight: 600;
  background: var(--bg-2); border: 1px solid var(--glass-bdr);
  color: var(--ink-0); box-shadow: var(--shadow); pointer-events: auto;
  animation: slideIn .25s ease;
}
.toast.success { border-color: rgba(34,197,94,.35); color: #86efac; }
.toast.error   { border-color: rgba(239,68,68,.35);  color: #fca5a5; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ─── Empty state / loader ─────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--ink-2); font-size: 14px;
}
.loader {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(79,142,247,.2); border-top-color: var(--accent);
  animation: spin .7s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .sidebar { width: 100%; height: auto; flex-direction: row; flex-wrap: wrap; padding: 14px; }
  .sidebar-foot { display: none; }
  .app { flex-direction: column; }
  .main { padding: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .file-row { grid-template-columns: 20px 1fr auto; }
  .fsize, .fmod { display: none; }
  .server-grid { grid-template-columns: 1fr; }
}
