/* ===============================
   FiveM Community Dashboard CSS
   Amazing Clean Design System (Sansation)
   =============================== */

/* Import Sansation Font */
@import url('https://fonts.googleapis.com/css2?family=Sansation:wght@300;400;700&display=swap');

/* Theme Variables */
:root {
  --bg-0: #050815;
  --bg-1: #0a0f1c;
  --bg-2: #111827;
  --glass: rgba(255,255,255,0.08);
  --glass-strong: rgba(255,255,255,0.15);
  --border: rgba(255,255,255,0.12);
  --border-strong: rgba(255,255,255,0.25);
  --txt: #f8fafc;
  --txt-muted: #94a3b8;
  --txt-dimmed: #64748b;
  --primary: #3b82f6;
  --primary-light: #60a5fa;
  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --success: #10b981;
  --success-light: #34d399;
  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --danger: #ef4444;
  --danger-light: #f87171;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.15);
  --shadow-md: 0 8px 25px rgba(0,0,0,0.25);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.35);
  --shadow-glow: 0 0 20px rgba(59,130,246,0.15);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --gap: 20px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  color-scheme: dark;
}



/* Global Styles */
* { box-sizing: border-box; margin: 0; padding: 0; }

body.dashboard {
  font-family: 'Sansation', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(1400px 700px at 20% -10%, rgba(59,130,246,0.08) 0%, rgba(0,0,0,0) 70%),
    radial-gradient(1200px 600px at 80% 20%, rgba(139,92,246,0.06) 0%, rgba(0,0,0,0) 70%),
    radial-gradient(800px 400px at 40% 100%, rgba(16,185,129,0.04) 0%, rgba(0,0,0,0) 70%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  background-attachment: fixed;
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Container */
.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* ===============================
   TOP NAV (uppe till höger länkar)
   =============================== */
.topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(10,15,28,0.7);
  backdrop-filter: blur(10px);
}
.topnav__brand { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--txt); }
.brand__dot {
  width: 14px; height: 14px; border-radius: 4px;
  background: linear-gradient(135deg,var(--primary),var(--accent));
  box-shadow: 0 0 20px rgba(59,130,246,0.6);
}
.brand__name { letter-spacing: .2px; }
.topnav__links { display: flex; gap: 14px; list-style: none; }
.topnav__links a {
  color: var(--txt); text-decoration: none; font-weight: 700;
  padding: 8px 12px; border-radius: 10px;
  transition: var(--transition-fast);
}
.topnav__links a:hover { background: var(--glass); transform: translateY(-1px); }
.topnav__links .is-staff { outline: 1px dashed rgba(245,158,11,0.35); }

/* ===============================
   HERO SECTION
   =============================== */
.dashboard-hero {
  position: relative; z-index: 0;
  padding: 40px 0 60px;
  background: linear-gradient(135deg, rgba(59,130,246,0.10) 0%, rgba(139,92,246,0.08) 50%, rgba(16,185,129,0.06) 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.dashboard-hero::before {
  content: ''; position: absolute; inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="0.5" fill="rgba(255,255,255,0.02)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: .3; pointer-events: none !important; z-index: 0;
}
.dashboard-hero .container { position: relative; z-index: 2; }

.dashboard-hero h1 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700; margin-bottom: 12px;
  background: linear-gradient(135deg, var(--txt) 0%, var(--txt-muted) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  letter-spacing: -0.02em; line-height: 1.2;
}
.dashboard-hero p {
  font-size: 18px; color: var(--txt-muted);
  margin-bottom: 32px; display: flex; align-items: center; gap: 12px;
}
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  background: var(--glass-strong); border: 1px solid var(--border); color: var(--txt);
  font-weight: 600; font-size: 14px; backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm); transition: var(--transition);
}
.badge:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 8px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ===============================
   BUTTONS
   =============================== */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--glass);
  color: var(--txt); font-family: inherit; font-weight: 600; font-size: 15px;
  text-decoration: none; transition: var(--transition); cursor: pointer;
  position: relative; overflow: hidden; backdrop-filter: blur(16px); box-shadow: var(--shadow-sm);
  z-index: 2;
}
.btn::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent); transition: left .5s ease;
}
.btn:hover::before { left: 100%; }
.btn:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn i { font-size: 16px; opacity: .9; }

.btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-color: transparent; color: white; box-shadow: var(--shadow-glow);
}
.btn.primary:hover { box-shadow: 0 0 30px rgba(59,130,246,0.25), var(--shadow-md); }

.btn.success {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
  border-color: transparent; color: white; box-shadow: 0 0 20px rgba(16,185,129,0.15);
}
.btn.success:hover { box-shadow: 0 0 30px rgba(16,185,129,0.25), var(--shadow-md); }

.btn.warn {
  background: linear-gradient(135deg, var(--warning) 0%, var(--warning-light) 100%);
  border-color: transparent; color: white; box-shadow: 0 0 20px rgba(245,158,11,0.15);
}
.btn.warn:hover { box-shadow: 0 0 30px rgba(245,158,11,0.25), var(--shadow-md); }

/* ===============================
   INTERACTION SAFETY (forms clickable)
   =============================== */
.tile, .stat-card { position: relative; z-index: 0; }
.tile::before,
.stat-card::before,
.stat-card::after { pointer-events: none !important; z-index: 0; }
.tile > *, .stat-card > * { position: relative; z-index: 2; }

/* Forms/inputs/buttons anywhere should be above visual overlays */
input, select, textarea, button, .btn, .submit { position: relative; z-index: 3; }

/* Make sure full-card links (like <a class="stat-card">) don’t block inputs in other cards */
a.stat-card, a.tile { z-index: 1; }

/* ===============================
   STATS GRID
   =============================== */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap); margin: 40px 0 60px;
}
.stat-card {
  position: relative; display: flex; align-items: center; gap: 20px;
  padding: 28px 24px; border-radius: var(--radius-lg);
  background: var(--glass); border: 1px solid var(--border);
  backdrop-filter: blur(20px); box-shadow: var(--shadow-md);
  transition: var(--transition); overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent)); opacity: 0; transition: opacity .3s ease;
  pointer-events: none;
}
.stat-card:hover::before { opacity: 1; }
.stat-card::after {
  content: ''; position: absolute; top: 50%; right: -20px; width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
  border-radius: 50%; transform: translateY(-50%); pointer-events: none;
}
.stat-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.stat-card i { font-size: 32px; opacity: .8; color: var(--primary-light); transition: var(--transition); z-index: 2; }
.stat-card:hover i { opacity: 1; transform: scale(1.08); }
.stat-card .k { font-size: 32px; font-weight: 700; line-height: 1; margin-bottom: 4px; color: var(--txt); }
.stat-card .label { font-size: 14px; color: var(--txt-muted); font-weight: 500; }
.meta { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.pill {
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: rgba(16,185,129,0.15); color: var(--txt); font-weight: 700; font-size: 12px;
}
.pill.danger { background: rgba(239,68,68,0.18); }

/* Live shimmer */
#server-status.loading .k {
  background: linear-gradient(90deg, var(--glass) 25%, var(--glass-strong) 50%, var(--glass) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; color: transparent;
}
@keyframes shimmer { 0% {background-position: -200% 0;} 100% {background-position: 200% 0;} }

/* ===============================
   TILE GRID / NAVIGATION CARDS
   =============================== */
.tile-grid, .tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap); margin: 40px 0 60px;
}
.tile {
  position: relative; display: block; padding: 32px 24px;
  border-radius: var(--radius-lg); background: var(--glass); border: 1px solid var(--border);
  color: var(--txt); text-decoration: none; backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm); transition: var(--transition); overflow: hidden;
}
.tile::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(59,130,246,0.02) 0%, rgba(139,92,246,0.01) 50%, rgba(16,185,129,0.01) 100%);
  opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.tile:hover::before { opacity: 1; }
.tile:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }

.tile i { font-size: 28px; opacity: .85; color: var(--primary-light); margin-bottom: 16px; transition: var(--transition); z-index: 2; }
.tile:hover i { opacity: 1; transform: scale(1.06); color: var(--primary); }
.tile h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; color: var(--txt); transition: var(--transition); z-index: 2; }
.tile:hover h3 { color: var(--primary-light); }
.tile p { font-size: 14px; color: var(--txt-muted); line-height: 1.5; margin: 0; z-index: 2; }

/* Inputs inside tiles (for “Koppla konto”) */
.tile form { margin-top: 12px; z-index: 3; }
.tile input[type="text"],
.tile input[type="password"],
.tile input[type="email"],
.tile input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  margin: 8px 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--txt);
  font: inherit;
  outline: none;
}
.tile input::placeholder { color: var(--txt-muted); }
.tile input:focus { border-color: var(--border-strong); box-shadow: 0 0 0 3px rgba(59,130,246,.25); }

/* If you’re using .submit from your old style.css, this ensures it sits above overlays */
.tile .submit { z-index: 3; }

.tile--staff { border: 1px dashed rgba(245,158,11,0.35); background: linear-gradient(135deg, rgba(245,158,11,0.05) 0%, rgba(249,115,22,0.03) 100%); }
.tile--staff i { color: var(--warning-light); }
.tile--staff:hover { border-color: rgba(245,158,11,0.5); box-shadow: 0 0 30px rgba(245,158,11,0.1), var(--shadow-lg); }

/* ===============================
   FOOTER
   =============================== */
.footer {
  margin-top: 80px; padding: 32px 0;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  color: var(--txt-dimmed); font-size: 14px;
  border-top: 1px solid rgba(255,255,255,0.05);
  background: var(--glass); backdrop-filter: blur(10px);
}
.footer .muted { opacity: .7; }

/* ===============================
   RESPONSIVE DESIGN
   =============================== */
@media (max-width: 1200px) {
  .container { padding: 0 20px; }
}
@media (max-width: 900px) {
  .hero { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 768px) {
  .dashboard-hero { padding: 32px 0 48px; }
  .dashboard-hero h1 { font-size: 28px; }
  .hero-actions { flex-direction: column; }
  .btn { justify-content: center; width: 100%; }
  .stat-card, .tile { padding: 24px 20px; }
  .topnav { padding: 10px 16px; }
  .topnav__links { flex-wrap: wrap; gap: 10px; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .dashboard-hero p { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ===============================
   ACCESSIBILITY & EXTRAS
   =============================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.btn:focus-visible, .tile:focus-visible, .topnav__links a:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
html { scroll-behavior: smooth; }
::selection { background: rgba(59,130,246,0.3); color: var(--txt); }
/* Scrollbar (webkit) */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--glass-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }


