/* ============================================================
   PORSEROSI ID Atlet Evolution — "STADIUM" Design System
   Hyper-Athletic • Immersive • Cyber-Stadium
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&family=Be+Vietnam+Pro:wght@100..900&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  /* Colors */
  --stadium-bg: #111415;
  --stadium-green: #00ff85;
  --stadium-green-glow: rgba(0,255,133,0.4);
  --stadium-pink: #ff4f72;
  --stadium-pink-glow: rgba(255,79,114,0.3);
  --stadium-blue: #04f5ff;
  
  --surface: #1d2021;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(40px);
  
  --white: #ffffff;
  --on-surface: #e1e3e4;
  --text-muted: #849584;
  
  /* Dimensions */
  --radius-xl: 1.5rem; /* 24px */
  --radius-lg: 0.75rem; /* 12px */
  --radius-full: 9999px;
  
  --header-h: 72px;
  --nav-h: 72px;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  background: var(--stadium-bg);
  color: var(--on-surface);
  height: 100dvh;
  overflow: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.font-headline { font-family: 'Lexend', sans-serif; }

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
a { color: inherit; text-decoration: none; }

/* ── Utilities ──────────────────────────────────────────── */
.glass-panel {
  background: var(--glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

.skew-x-custom {
  display: inline-block;
  transform: skewX(-10deg);
}

.neon-glow {
  /* Glow removed */
}

.neon-text {
  color: var(--stadium-green);
}

.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }
.tracking-tighter { letter-spacing: -0.04em; }
.drop-shadow-lg { filter: drop-shadow(0 0 8px var(--stadium-green-glow)); }

/* Spacing Utilities */
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-40 { margin-bottom: 40px; }

/* ── App Shell ──────────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }

.immersive-bg {
  position: fixed;
  inset: 0;
  z-index: -10;
  overflow: hidden;
}

.immersive-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
  filter: blur(2px);
  transform: scale(1.1);
}

.immersive-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--stadium-bg) 0%, rgba(17, 20, 21, 0) 100%);
}

/* Header */
.app-header {
  position: fixed; top: 0; left: 0;
  width: 100%; z-index: 100;
  height: var(--header-h);
  background: rgba(17, 20, 21, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}

.header-logo {
  font-family: 'Lexend', sans-serif;
  font-size: 24px;
  font-weight: 900;
  color: var(--stadium-green);
  font-style: italic;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.profile-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--stadium-green);
  overflow: hidden;
}

/* Bottom Nav */
.bottom-nav-container {
  position: fixed;
  bottom: 10px;
  left: 0;
  width: 100%;
  padding: 0 20px;
  z-index: 100;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.bottom-nav-container.hide {
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
}

.bottom-nav {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  width: 48px; height: 48px;
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.active {
  color: var(--stadium-green);
  transform: scale(1.2);
}

.nav-item span {
  font-family: 'Material Symbols Outlined';
  font-size: 36px;
}

/* ── Typography ─────────────────────────────────────────── */
.h1 { font-family: 'Lexend'; font-size: 32px; font-weight: 900; line-height: 1.1; letter-spacing: -0.05em; }
.h2 { font-family: 'Lexend'; font-size: 24px; font-weight: 800; line-height: 1.2; }
.label { font-family: 'Lexend'; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--text-muted); text-transform: uppercase; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ── Stats Grid & Matrix ────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.stat-card-main {
  grid-column: span 8;
  height: 240px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.stat-card-small {
  grid-column: span 4;
  height: 240px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-mini-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.matrix-card {
  margin-top: 24px;
  padding: 32px;
}

.matrix-bar-group { margin-bottom: 24px; }
.matrix-label { display: flex; justify-content: space-between; font-size: 10px; font-weight: 800; margin-bottom: 8px; color: var(--text-muted); }
.matrix-track { height: 6px; background: #2d3031; border-radius: 3px; overflow: hidden; }
.matrix-fill { height: 100%; border-radius: 3px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-family: 'Lexend', sans-serif;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--stadium-green);
  color: #111415;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  backdrop-filter: blur(10px);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-stadium {
  background: var(--stadium-green);
  color: #111415;
  border-radius: var(--radius-full);
  padding: 16px 32px;
  font-weight: 900;
  text-transform: uppercase;
  font-family: 'Lexend';
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid transparent;
}
.btn-stadium:active { transform: scale(0.96); }

.btn-stadium.btn-outline {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
}

.btn-stadium.btn-outline:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.4);
}

.stadium-input-pill {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.4);
  padding: 16px 24px;
  border-radius: var(--radius-full);
  color: white;
  font-family: inherit;
  outline: none;
  font-size: 13px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.stadium-input-pill:focus {
  border-color: var(--stadium-green);
  background: rgba(0,255,133,0.05);
  box-shadow: 0 0 20px rgba(0,255,133,0.1);
}

.stadium-input-pill::placeholder {
  color: rgba(255,255,255,0.3);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
}

/* ── News Feed (Instagram Style) ────────────────────────── */
.news-post {
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 32px;
  border: 1px solid var(--glass-border);
}

.news-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #222;
}

.news-content {
  padding: 16px;
}

.news-headline {
  font-family: 'Be Vietnam Pro';
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  color: var(--white);
  margin-bottom: 8px;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rank-row-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.2s;
}
.rank-row-compact:active { background: rgba(255,255,255,0.05); }

.btn-fab {
  position: absolute;
  bottom: 100px;
  right: 20px;
  width: 64px; height: 64px;
  background: var(--stadium-green);
  color: #111415;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  transform: skewX(-10deg);
  transition: transform 0.2s;
}

.btn-fab:active { transform: skewX(-10deg) scale(0.9); }

/* ── Rank Filters (Pill Menu) ───────────────────────────── */
.rank-filter {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px 0;
  margin: 0 -4px;
}
.rank-filter::-webkit-scrollbar { display: none; }

.rank-filter button {
  padding: 8px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  color: var(--white);
  font-family: 'Lexend';
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  opacity: 0.6;
}

.rank-filter button.active {
  background: var(--stadium-green);
  color: #111;
  border-color: var(--stadium-green);
  transform: scale(1.05);
  opacity: 1;
}

/* ── Animations ─────────────────────────────────────────── */
/* ── Photorealistic iPhone 17 Air Mockup ───────────────────── */
.device-mockup {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  min-height: 100vh;
  background: radial-gradient(circle at center, #2c2e30 0%, #000000 100%);
}

.device-frame {
  --phone-w: 393px;
  --phone-h: 852px;
  width: var(--phone-w);
  height: var(--phone-h);
  background: #000;
  border-radius: 56px;
  padding: 10px;
  position: relative;
  box-shadow: 
    0 0 0 2px #d1d1d6,
    0 0 0 6px #f2f2f7,
    0 0 0 8px #d1d1d6,
    0 30px 60px rgba(0,0,0,0.15);
  margin: auto;
  /* Automatic scaling to fit any screen height */
  transform: scale(calc(min(0.9, (90vh / 852))));
  transform-origin: center center;
}

.device-screen {
  width: 100%;
  height: 100%;
  background: var(--stadium-bg);
  border-radius: 46px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Virtual Status Bar */
.status-bar {
  height: 44px;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  z-index: 210;
  position: absolute;
  top: 0; left: 0; right: 0;
}

.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 5px;
  background: rgba(255,255,255,0.3);
  border-radius: 10px;
  z-index: 210;
}

.device-notch {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 26px;
  background: #000;
  border-radius: 20px;
  z-index: 200;
  box-shadow: inset 0 0 1px rgba(255,255,255,0.2);
}

/* Speaker detail inside notch */
.device-notch::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 2px;
  background: #111;
  border-radius: 2px;
}

.device-screen #app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1;
  padding: 24px;
  padding-top: calc(var(--header-h) + 10px);
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.app-main::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.immersive-bg {
  position: absolute;
  inset: 0;
  z-index: -10;
  overflow: hidden;
}

/* Fix for immersive backgrounds inside absolute main */
.immersive-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
}

@keyframes stadium-fade-up {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes stadium-pulse {
  0% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.05); opacity: 0.6; }
  100% { transform: scale(1); opacity: 0.4; }
}

/* ── Specific Overrides for PORSEROSI logic ─────────────── */
.stories-container { margin: 0 -24px; padding: 0 24px; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
.stories-container::-webkit-scrollbar { display: none; }
.stories-track { display: flex; gap: 16px; padding: 16px 0; }
.story-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  border: 2px solid var(--glass-border); padding: 4px;
  transition: all 0.3s;
}
.story-card.active .story-avatar { border-color: var(--stadium-green); }
.story-avatar-inner { width: 100%; height: 100%; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 28px; }

/* ID CARD — STADIUM VERSION */
.stadium-id-card {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--stadium-green);
  color: #111415;
  border-radius: 100px;
  font-weight: 800;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: stadium-pulse 2s infinite;
}

.id-qr-box {
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
}

.id-qr-image {
  background: white;
  padding: 8px;
  border-radius: 8px;
  width: 80px; height: 80px;
}

/* Spinner */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid rgba(0,255,133,0.2);
  border-top-color: var(--stadium-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- ADMIN COMMAND CENTER STYLES --- */
.module-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.toggle-switch {
  width: 48px;
  height: 24px;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--glass-border);
}

.switch-ui {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

#reg-toggle:checked + .switch-ui {
  left: 26px;
  background: var(--stadium-green);
  box-shadow: 0 0 10px var(--stadium-green);
}

.btn-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

/* -- News Interaction -------------------------- */
.news-post { cursor: pointer; transition: transform 0.2s; }
.news-post:active { transform: scale(0.98); }
.article-content { word-break: break-word; overflow-wrap: break-word; }
.article-content img { border-radius: 12px; margin: 16px 0; max-width: 100% !important; height: auto !important; object-fit: contain; }
.article-content p { margin-bottom: 24px; color: rgba(255,255,255,0.9) !important; }
.article-content span { color: rgba(255,255,255,0.9) !important; }
.article-content h1, .article-content h2, .article-content h3 { margin: 32px 0 16px; color: white !important; line-height: 1.2; }
.article-content ul, .article-content ol { margin: 20px 0; padding-left: 24px; }
.article-content li { margin-bottom: 12px; }
.article-content blockquote { border-left: 4px solid var(--stadium-green); padding-left: 16px; font-style: italic; color: var(--text-muted); margin: 24px 0; }


/* -- Spacing Utilities -------------------------- */
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }
.p-32 { padding: 32px; }
.p-40 { padding: 40px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }


/* -- Layout Utilities -------------------------- */
.overflow-y-auto { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.flex-1 { flex: 1; }

/* ── Toast System ───────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 32px;
  left: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  background: rgba(20, 22, 23, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  padding: 16px 20px;
  border-radius: 20px;
  color: white;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.4);
  transform: translateY(-40px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  pointer-events: auto;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { border-left: 4px solid var(--stadium-green); }
.toast.error   { border-left: 4px solid var(--stadium-pink); }
.toast.info    { border-left: 4px solid var(--stadium-blue); }

.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.toast.success .toast-icon { background: var(--stadium-green); color: black; }
.toast.error   .toast-icon { background: var(--stadium-pink); color: white; }
.toast.info    .toast-icon { background: var(--stadium-blue); color: black; }

