/* ============================================================
   AllyGridHub — Foglio di stile principale
   public/assets/css/main.css
   ============================================================ */

/* ── Reset & variabili ────────────────────────────────────── */
:root {
  --bg0:      #080b0f;
  --bg1:      #0d1117;
  --bg2:      #111820;
  --bg3:      #162030;
  --border:   #1e3a4a;
  --border2:  #2a5060;
  --accent:   #00c8ff;
  --green:    #00ff9d;
  --orange:   #ff6b35;
  --gold:     #c8a84b;
  --red:      #ff3b3b;
  --text1:    #e0eef5;
  --text2:    #7aa0b5;
  --text3:    #3d6070;
  --rank5:    #ff6b35;
  --rank4:    #c8a84b;
  --rank3:    #7b9fd4;
  --rank2:    #4db890;
  --rank1:    #6a7a8a;
  --radius:   4px;
  --radius-lg:8px;
  --font-main:'Rajdhani', sans-serif;
  --font-mono:'Share Tech Mono', monospace;
  --font-head:'Orbitron', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: var(--font-main);
  background: var(--bg0);
  color: var(--text1);
  min-height: 100vh;
  line-height: 1.5;
}

/* Scan-line overlay decorativo */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px,
    rgba(0,200,255,0.012) 2px, rgba(0,200,255,0.012) 4px);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Logo ─────────────────────────────────────────────────── */
.logo {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--accent);
}
.logo .g { color: var(--text1); }
.logo .b { color: var(--green); }

/* ── Navigazione ──────────────────────────────────────────── */
.topnav {
  display: flex; align-items: center; gap: 0;
  background: var(--bg1);
  border-bottom: 1px solid var(--border);
  height: 52px; padding: 0 16px;
  position: sticky; top: 0; z-index: 100;
}
.topnav::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.35;
}
.nav-tabs { display: flex; height: 100%; flex: 1; gap: 0; }
.nav-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px; height: 100%;
  font-family: var(--font-main); font-size: 13px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--text2); border-bottom: 2px solid transparent;
  background: none; border-left: none; border-right: none; border-top: none;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.nav-tab:hover { color: var(--text1); background: rgba(0,200,255,0.04); }
.nav-tab.active { color: var(--accent); border-bottom-color: var(--accent); background: rgba(0,200,255,0.07); }

.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.server-time {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--green); background: var(--bg2);
  border: 1px solid var(--border); padding: 4px 8px;
  border-radius: var(--radius); letter-spacing: 1px;
}

/* ── Layout ───────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 20px 16px; }
.page-title {
  font-family: var(--font-head); font-size: 16px; font-weight: 700;
  color: var(--accent); letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 20px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}

/* ── Panel / Card ─────────────────────────────────────────── */
.panel {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 12px;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--bg2); border-bottom: 1px solid var(--border);
}
.panel-title {
  font-family: var(--font-head); font-size: 10px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase; color: var(--accent);
}
.panel-body { padding: 12px 14px; }

/* ── Stat card ────────────────────────────────────────────── */
.stat-card {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; position: relative; overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.stat-card.cyan::before  { background: var(--accent); }
.stat-card.green::before { background: var(--green); }
.stat-card.orange::before{ background: var(--orange); }
.stat-card.gold::before  { background: var(--gold); }
.stat-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--text3); margin-bottom: 6px; font-weight: 600; }
.stat-value { font-family: var(--font-head); font-size: 24px; font-weight: 700; color: var(--text1); }
.stat-sub   { font-size: 11px; color: var(--text2); margin-top: 4px; }

/* ── Form ─────────────────────────────────────────────────── */
.form-card {
  background: var(--bg1); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.form-section { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: none; }
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group label {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text3); font-weight: 700;
}
.form-hint { font-size: 11px; color: var(--text3); margin-top: 3px; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], select, textarea {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 12px;
  color: var(--text1); font-family: var(--font-main); font-size: 14px;
  outline: none; width: 100%; transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text3); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%233d6070' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
textarea { resize: vertical; min-height: 80px; }

.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  font-family: var(--font-main); font-size: 13px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  cursor: pointer; border: 1px solid; transition: all 0.15s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: rgba(0,200,255,0.1); border-color: var(--accent); color: var(--accent); }
.btn-primary:hover { background: rgba(0,200,255,0.2); text-decoration: none; }
.btn-green  { background: rgba(0,255,157,0.1); border-color: var(--green); color: var(--green); }
.btn-green:hover { background: rgba(0,255,157,0.2); }
.btn-danger { background: rgba(255,59,59,0.1); border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: rgba(255,59,59,0.2); }
.btn-ghost  { background: transparent; border-color: var(--border); color: var(--text2); }
.btn-ghost:hover { border-color: var(--border2); color: var(--text1); }
.btn-block  { width: 100%; justify-content: center; }
.btn-sm     { padding: 4px 10px; font-size: 11px; }

/* ── Badge ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 2px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-all      { background: rgba(0,200,255,0.15); color: var(--accent); }
.badge-r5       { background: rgba(255,107,53,0.15); color: var(--rank5); }
.badge-r4       { background: rgba(200,168,75,0.15); color: var(--rank4); }
.badge-r3       { background: rgba(123,159,212,0.15); color: var(--rank3); }
.badge-r2       { background: rgba(77,184,144,0.15); color: var(--rank2); }
.badge-r1       { background: rgba(106,122,138,0.15); color: var(--rank1); }
.badge-personal { background: rgba(0,255,157,0.12); color: var(--green); }
.badge-success  { background: rgba(0,255,157,0.12); color: var(--green); }
.badge-warning  { background: rgba(200,168,75,0.15); color: var(--gold); }
.badge-danger   { background: rgba(255,59,59,0.12); color: var(--red); }

/* ── Rank icon ────────────────────────────────────────────── */
.rank-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 3px;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.rank-icon.r5 { background: rgba(255,107,53,0.2); color: var(--rank5); border: 1px solid var(--rank5); }
.rank-icon.r4 { background: rgba(200,168,75,0.2); color: var(--rank4); border: 1px solid var(--rank4); }
.rank-icon.r3 { background: rgba(123,159,212,0.2); color: var(--rank3); border: 1px solid var(--rank3); }
.rank-icon.r2 { background: rgba(77,184,144,0.2); color: var(--rank2); border: 1px solid var(--rank2); }
.rank-icon.r1 { background: rgba(106,122,138,0.2); color: var(--rank1); border: 1px solid var(--rank1); }

/* ── Alerts ───────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 14px; }
.alert-danger  { background: rgba(255,59,59,0.1); border: 1px solid var(--red); color: var(--red); }
.alert-success { background: rgba(0,255,157,0.1); border: 1px solid var(--green); color: var(--green); }
.alert-info    { background: rgba(0,200,255,0.1); border: 1px solid var(--accent); color: var(--accent); }
.alert-warning { background: rgba(200,168,75,0.1); border: 1px solid var(--gold); color: var(--gold); }

/* ── Table ────────────────────────────────────────────────── */
.agh-table { width: 100%; border-collapse: collapse; }
.agh-table th {
  text-align: left; padding: 8px 12px;
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text3); font-weight: 600;
  border-bottom: 1px solid var(--border); background: var(--bg2);
}
.agh-table td { padding: 10px 12px; border-bottom: 1px solid var(--bg3); vertical-align: middle; }
.agh-table tr:hover td { background: rgba(0,200,255,0.025); }
.agh-table tr:last-child td { border-bottom: none; }

/* ── Status dot ───────────────────────────────────────────── */
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.s-online  { background: var(--green); }
.s-away    { background: var(--gold); }
.s-offline { background: var(--text3); }

/* ── Progress bar ─────────────────────────────────────────── */
.progress-bar { height: 4px; background: var(--bg3); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 2px; transition: width 0.4s; }

/* ── Auth pages ───────────────────────────────────────────── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-wrap { width: 100%; max-width: 460px; padding: 16px; }
.auth-box { background: var(--bg1); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.auth-header { background: var(--bg2); padding: 20px; border-bottom: 1px solid var(--border); text-align: center; }
.auth-header .logo { display: block; font-size: 22px; margin-bottom: 4px; }
.auth-header p { font-size: 12px; color: var(--text2); letter-spacing: 1px; }
.auth-body { padding: 20px; }
.auth-link { font-size: 13px; color: var(--text2); text-align: center; margin-top: 14px; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg1); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── Grid helpers ─────────────────────────────────────────── */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 768px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .nav-tabs .nav-tab span.label { display: none; }
}
@media (max-width: 480px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ── RSVP buttons ─────────────────────────────────────────── */
.rsvp-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.rsvp-btn { padding: 6px 14px; border-radius: var(--radius); border: 1px solid; cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.15s; }
.rsvp-btn.confirm { border-color: var(--green); color: var(--green); background: transparent; }
.rsvp-btn.confirm.active, .rsvp-btn.confirm:hover { background: rgba(0,255,157,0.15); }
.rsvp-btn.maybe   { border-color: var(--gold);  color: var(--gold);  background: transparent; }
.rsvp-btn.maybe.active, .rsvp-btn.maybe:hover   { background: rgba(200,168,75,0.15); }
.rsvp-btn.absent  { border-color: var(--red);   color: var(--red);   background: transparent; }
.rsvp-btn.absent.active, .rsvp-btn.absent:hover  { background: rgba(255,59,59,0.15); }

/* ── Countdown ────────────────────────────────────────────── */
.countdown { font-family: var(--font-mono); font-size: 14px; color: var(--accent); letter-spacing: 1px; }
.countdown.urgent { color: var(--red); }
.countdown.ongoing { color: var(--green); }

/* ── Chat ─────────────────────────────────────────────────── */
.chat-layout { display: grid; grid-template-columns: 200px 1fr; gap: 12px; height: calc(100vh - 90px); }
.chat-sidebar { background: var(--bg1); border: 1px solid var(--border); border-radius: var(--radius); overflow-y: auto; }
.channel-group { padding: 8px 12px 2px; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--text3); font-weight: 700; }
.channel-item { display: flex; align-items: center; gap: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text2); border-left: 2px solid transparent; transition: all 0.15s; }
.channel-item:hover { background: rgba(0,200,255,0.05); color: var(--text1); }
.channel-item.active { background: rgba(0,200,255,0.08); color: var(--accent); border-left-color: var(--accent); }
.ch-unread { margin-left: auto; background: var(--red); color: #fff; font-size: 9px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.chat-main { background: var(--bg1); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 10px; }
.msg-avatar { width: 30px; height: 30px; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.msg-body { flex: 1; }
.msg-sender { font-size: 13px; font-weight: 700; }
.msg-ts { font-family: var(--font-mono); font-size: 10px; color: var(--text3); margin-left: 8px; }
.msg-text { font-size: 13px; color: var(--text2); line-height: 1.5; margin-top: 2px; }
.chat-input-row { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--bg2); flex-shrink: 0; }
.chat-input { flex: 1; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; color: var(--text1); font-family: var(--font-main); font-size: 13px; outline: none; }
.chat-input:focus { border-color: var(--accent); }

/* ── Gift links ───────────────────────────────────────────── */
.link-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg1); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; transition: border-color 0.15s; }
.link-card:hover { border-color: var(--border2); }
.link-icon { font-size: 20px; flex-shrink: 0; }
.link-info { flex: 1; }
.link-title { font-size: 14px; font-weight: 600; color: var(--text1); }
.link-desc  { font-size: 11px; color: var(--text2); margin-top: 2px; }
.link-report { font-size: 11px; color: var(--text3); cursor: pointer; background: none; border: none; padding: 0; }
.link-report:hover { color: var(--red); }
