/* ============================================================
   SCOUT — Design System
   P&P Sport Management · Palette ufficiale dal sito sportmanagement.mc
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=Barlow:wght@300;400;500;600;700&display=swap');

/* ── Variabili ────────────────────────────────────────────── */
:root {
  /* Colori primari (estratti da sportmanagement.mc) */
  --navy:          #1A1A2E;
  --blue:          #0D2545;
  --gold:          #B8912A;
  --gold-light:    #D4A83A;
  --white:         #FFFFFF;

  /* Colori secondari */
  --cream:         #F5EDD4;
  --warm-white:    #FAF8F4;
  --warm-grey:     #F2EEE6;
  --grey-mid:      #6B7280;

  /* Overlay / trasparenze */
  --white-95:      rgba(255,255,255,0.95);
  --white-68:      rgba(255,255,255,0.68);
  --white-45:      rgba(255,255,255,0.45);
  --white-20:      rgba(255,255,255,0.20);
  --white-08:      rgba(255,255,255,0.08);
  --white-04:      rgba(255,255,255,0.04);
  --blue-12:       rgba(13,37,69,0.12);
  --gold-30:       rgba(184,145,42,0.30);
  --gold-15:       rgba(184,145,42,0.15);
  --gold-08:       rgba(184,145,42,0.08);

  /* Font */
  --serif:         'Cormorant Garamond', Georgia, serif;
  --sans:          'Barlow', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Raggi */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;

  /* Sidebar */
  --sidebar-w: 240px;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--sans);
  font-weight: 400;
  background: var(--blue);
  color: var(--white);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: var(--sans); cursor: pointer; }
img { display: block; max-width: 100%; }

/* ── Tipografia ───────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; }


/* ================================================================
   LOGIN
   ================================================================ */
.login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: linear-gradient(160deg, var(--blue) 0%, var(--navy) 100%);
}
.login-logo {
  width: 72px; height: 72px;
  margin-bottom: 20px;
}
.login-title {
  font-family: var(--serif);
  font-size: 3.8rem;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 12px;
  margin-bottom: 48px;
}
.login-form { width: 100%; max-width: 380px; }
.form-group { margin-bottom: 22px; }
.form-label {
  display: block;
  font-size: 0.7rem; font-weight: 600;
  color: var(--white-45);
  letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 8px;
}
.form-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--white-08);
  border: 1px solid var(--white-20);
  border-radius: var(--r-sm);
  color: var(--white);
  font-family: var(--sans); font-size: 15px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.form-input::placeholder { color: var(--white-45); }
.form-input:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255,255,255,0.10);
  box-shadow: 0 0 0 3px var(--gold-15);
}
.password-wrapper { position: relative; }
.password-toggle {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--white-45); font-size: 18px;
  transition: color 0.2s;
}
.password-toggle:hover { color: var(--gold-light); }
.checkbox-group {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
}
.checkbox-group input[type=checkbox] {
  width: 17px; height: 17px;
  accent-color: var(--gold);
}
.checkbox-group label { font-size: 14px; color: var(--white-68); }
.btn-primary {
  display: flex; align-items: center; justify-content: center;
  width: 100%;
  padding: 16px;
  background: var(--gold);
  border: none; border-radius: var(--r-sm);
  color: var(--navy);
  font-family: var(--sans); font-size: 14px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 5px 20px var(--gold-30);
}
.login-footer {
  margin-top: 36px;
  font-size: 0.72rem; color: var(--white-45);
  letter-spacing: 1px; text-align: center;
}


/* ================================================================
   SPLASH / LOADING
   ================================================================ */
.loading-screen {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--blue) 0%, var(--navy) 100%);
}
.loading-title {
  font-family: var(--serif);
  font-size: 3.5rem; font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 8px; margin-bottom: 10px;
}
.loading-subtitle {
  font-size: 0.72rem; font-weight: 600;
  color: var(--white-68);
  letter-spacing: 3px; margin-bottom: 48px;
  text-transform: uppercase;
}
.loading-spinner {
  width: 46px; height: 46px;
  border: 3px solid var(--gold-15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 18px;
}
.loading-text {
  font-size: 0.72rem; font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 2px; text-transform: uppercase;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ================================================================
   DASHBOARD LAYOUT
   ================================================================ */
body.dashboard {
  display: flex;
  background: #0a1628;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: #061020;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0;
  height: 100vh; z-index: 100;
  transition: transform 0.28s ease;
}

.sidebar-profile {
  padding: 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.profile-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #1c3555;
  border: 2px solid #2a4a6f;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: var(--white);
  margin-bottom: 11px; overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name  { font-size: 14px; font-weight: 600; color: var(--white); margin-bottom: 2px; }
.profile-role  { font-size: 11px; color: var(--white-45); margin-bottom: 8px; }
.profile-badge {
  display: inline-block;
  padding: 2px 9px;
  background: var(--gold-15);
  border: 1px solid var(--gold-30);
  border-radius: 20px;
  font-size: 9px; font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.6px; text-transform: uppercase;
}

.sidebar-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 18px;
  font-size: 13px; font-weight: 500;
  color: var(--white-45);
  border-left: 3px solid transparent;
  transition: all 0.16s;
  text-decoration: none;
  cursor: pointer;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.65; }
.nav-item:hover {
  background: var(--white-04);
  color: var(--white-68);
  border-left-color: var(--gold-30);
}
.nav-item:hover svg { opacity: 0.85; }
.nav-item.active {
  background: var(--gold-08);
  color: var(--gold-light);
  border-left-color: var(--gold);
}
.nav-item.active svg { opacity: 1; }

/* ── Gruppo / sottomenu admin ─────────────────────────────── */
.nav-group {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.nav-group-label {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 18px 6px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--gold-light);
}
.nav-group-label svg { width: 14px; height: 14px; opacity: 0.7; }
.nav-subitem {
  padding-left: 38px;
  font-size: 12.5px;
}

.nav-logout {
  margin: 0 12px 8px;
  border-left-color: transparent;
  color: rgba(255,255,255,0.4);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 14px;
  margin-top: 4px;
}
.nav-logout:hover {
  color: #ff6b6b;
  background: rgba(255,80,80,0.08);
  border-left-color: #ff6b6b;
}
.nav-logout:hover svg { opacity: 1; }

.sidebar-brand {
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}
.sidebar-brand span {
  font-family: var(--serif);
  font-size: 18px; font-weight: 600;
  color: var(--gold);
  letter-spacing: 6px;
}

/* ── Main content ─────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 36px 40px;
  min-height: 100vh;
}

/* Mobile topbar (hidden desktop) */
.mobile-topbar {
  display: none;
  align-items: center; gap: 14px;
  padding: 11px 16px;
  background: #061020;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin: -36px -40px 24px;
}
.hamburger {
  background: none; border: none;
  color: var(--white); line-height: 0; padding: 4px;
}

/* Overlay per sidebar mobile */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between; align-items: flex-start;
  margin-bottom: 26px; gap: 16px;
}
.page-title {
  font-family: var(--serif);
  font-size: 2.5rem; font-weight: 600;
  color: var(--white); margin-bottom: 5px;
}
.page-subtitle { font-size: 13px; color: var(--white-45); }

/* ── Bottoni ─────────────────────────────────────────────── */
.btn-gold {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  background: var(--gold); border: none; border-radius: var(--r-sm);
  color: var(--navy);
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
  white-space: nowrap;
}
.btn-gold:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px var(--gold-30);
}
.btn-gold svg { width: 15px; height: 15px; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 15px;
  background: transparent;
  border: 1px solid var(--white-20);
  border-radius: var(--r-sm);
  color: var(--white-68);
  font-size: 13px; font-weight: 500;
  transition: all 0.18s;
}
.btn-outline:hover {
  border-color: var(--gold-30);
  color: var(--gold-light);
  background: var(--gold-08);
}

.icon-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--white-04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-sm);
  color: var(--white-45);
  transition: all 0.18s;
}
.icon-btn:hover {
  background: var(--white-08);
  color: var(--white-68);
  border-color: var(--white-20);
}
.icon-btn svg { width: 15px; height: 15px; }
.btn-danger {
  display: inline-flex; align-items: center;
  padding: 7px 15px;
  background: rgba(220, 53, 69, 0.12);
  border: 1px solid rgba(220, 53, 69, 0.40);
  border-radius: var(--r-sm);
  color: #ff6b6b; cursor: pointer;
  font-size: 13px; font-weight: 500;
  transition: all 0.18s;
}
.btn-danger:hover {
  background: rgba(220, 53, 69, 0.22);
  border-color: rgba(220, 53, 69, 0.65);
  color: #ff8585;
}
.btn-danger:disabled { opacity: 0.5; cursor: default; }

/* ── Filter bar ──────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.filter-search {
  position: relative;
  flex: 1; min-width: 160px; max-width: 300px;
}
.filter-search input {
  width: 100%;
  padding: 9px 13px 9px 36px;
  background: var(--white-04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-sm);
  color: var(--white); font-size: 13px;
  transition: border-color 0.18s, background 0.18s;
}
.filter-search input::placeholder { color: rgba(255,255,255,0.25); }
.filter-search input:focus {
  outline: none;
  border-color: var(--gold-30);
  background: var(--white-08);
}
.filter-search-icon {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.25); pointer-events: none;
}
.filter-search-icon svg { width: 14px; height: 14px; }

.filter-select {
  padding: 9px 32px 9px 12px;
  background: var(--white-04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-sm);
  color: var(--white); font-family: var(--sans); font-size: 13px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.3)' stroke-width='2.5'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color 0.18s;
}
.filter-select:focus { outline: none; border-color: var(--gold-30); }
.filter-select option {
  background: var(--blue);
  color: var(--white);
  padding: 8px 12px;
}
.filter-spacer { flex: 1; min-width: 8px; }

/* ── Tabella posizioni ───────────────────────────────────── */
.table-wrap {
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-lg);
  overflow: hidden;
}
table.pos-table { width: 100%; border-collapse: collapse; }
.pos-table thead th {
  padding: 11px 14px;
  text-align: left;
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.28);
  letter-spacing: 0.9px; text-transform: uppercase;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  white-space: nowrap;
}
.pos-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.12s;
}
.pos-table tbody tr:last-child { border-bottom: none; }
.pos-table tbody tr:hover { background: rgba(255,255,255,0.025); }
.pos-table td { padding: 13px 14px; vertical-align: middle; }

/* Club cell */
.club-cell { display: flex; align-items: center; gap: 12px; }
.club-logo-box {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: var(--r-sm);
  background: #122035;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.club-logo-box img {
  width: 100%; height: 100%;
  object-fit: contain; padding: 4px;
}
.club-initials {
  font-size: 10px; font-weight: 700;
  color: var(--white-45); letter-spacing: 0;
}
.club-name-text  { font-size: 13px; font-weight: 600; color: var(--white); line-height: 1.2; }
.club-league-text { font-size: 11px; color: var(--white-45); margin-top: 2px; }

/* Role badges */
.role-badge {
  display: inline-block; padding: 4px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 500;
  white-space: nowrap;
}
.role-gk  { background:rgba(130,80,200,0.16); color:#b48ce0; border:1px solid rgba(130,80,200,0.25); }
.role-def { background:rgba(40,130,200,0.16); color:#6db5e5; border:1px solid rgba(40,130,200,0.25); }
.role-mid { background:rgba(184,145,42,0.16); color:var(--gold-light); border:1px solid var(--gold-30); }
.role-fwd { background:rgba(210,65,65,0.16);  color:#e47575; border:1px solid rgba(210,65,65,0.25); }

/* Stars */
.stars { display: flex; gap: 2px; }
.star { font-size: 14px; }
.star.on  { color: var(--gold); }
.star.off { color: rgba(255,255,255,0.15); }

/* Budget */
.budget-val { font-size: 13px; font-weight: 500; color: var(--white-68); }
.budget-nd  { font-size: 12px; color: rgba(255,255,255,0.22); }

/* Fonti badges */
.fonti {
    display: flex;
    gap: 4px;
}

.fonti-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid;
    position: relative;
}

.fonti-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid white;
}

.fonti-favicon {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}  

/* Date */
.date-val { font-size: 12px; color: var(--white-45); white-space: nowrap; }

/* Empty state */
.empty-row td {
  text-align: center; padding: 56px 20px;
  color: rgba(255,255,255,0.22); font-size: 14px;
}

/* ── Card (mobile) ───────────────────────────────────────── */
.position-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-md);
  padding: 16px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.position-card:hover {
  border-color: var(--gold-30);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13,37,69,0.35);
}


/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1100px) {
  .main-content { padding: 28px 28px; }
  .mobile-topbar { margin: -28px -28px 22px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 240px; }

  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }

  .main-content {
    margin-left: 0;
    padding: 16px;
  }
  .mobile-topbar { display: flex; margin: -16px -16px 20px; }

  .page-header { flex-direction: column; align-items: flex-start; }
  .page-title { font-size: 2rem; }

  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-search { max-width: 100%; }
  .filter-select { width: 100%; }
  .filter-spacer, .icon-btn { display: none; }

  /* Nascondi colonne secondarie su mobile */
  .col-rank, .col-fonti { display: none; }
  .pos-table td, .pos-table th { padding: 10px 10px; }
  .club-logo-box { width: 34px; height: 34px; }
}

@media (max-width: 480px) {
  .page-title { font-size: 1.75rem; }
  .col-date { display: none; }
  .main-content { padding: 12px; }
  .mobile-topbar { margin: -12px -12px 16px; }
}

/* ── Fonti Page Styles ───────────────────────────────────── */
.sources-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.sources-column {
  display: flex;
  flex-direction: column;
}

.sources-card {
  background: var(--navy);
  border-radius: var(--r-lg);
  border: 1px solid var(--white-20);
  overflow: hidden;
  backdrop-filter: blur(20px);
  height: 100%;
}

.sources-header {
  background: var(--white-08);
  padding: 20px 24px;
  border-bottom: 1px solid var(--white-20);
}

.sources-header h3 {
  font-family: var(--sans);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.sources-header svg {
  width: 20px;
  height: 20px;
  stroke: var(--gold);
}

.sources-header .count {
  background: var(--gold);
  color: var(--navy);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: auto;
}

.sources-list {
  padding: 20px 24px;
  max-height: 500px;
  overflow-y: auto;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--white-08);
}

.source-item:last-child {
  border-bottom: none;
}

.source-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.web-icon {
  background: var(--blue-12);
  border: 2px solid var(--gold-30);
}

.web-icon::before {
  content: "🌐";
  font-size: 14px;
}

.x-icon {
  background: var(--gold-15);
  border: 2px solid var(--gold-30);
}

.x-icon::before {
  content: "𝕏";
  font-size: 16px;
  font-weight: 600;
  color: var(--gold);
}

.source-link {
  color: var(--white);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.source-link:hover {
  color: var(--gold);
}

.source-item span {
  color: var(--white);
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
}

.empty-state {
  color: var(--white-45);
  font-family: var(--sans);
  font-size: 0.875rem;
  text-align: center;
  padding: 40px 0;
}

.stats-section {
  margin-top: 32px;
}

.stats-card {
  background: var(--navy);
  border-radius: var(--r-lg);
  border: 1px solid var(--white-20);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.stats-header {
  background: var(--white-08);
  padding: 20px 24px;
  border-bottom: 1px solid var(--white-20);
}

.stats-header h3 {
  font-family: var(--sans);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--white);
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--white-08);
}

.stat-item {
  background: var(--navy);
  padding: 24px;
  text-align: center;
}

.stat-number {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 8px;
}

.stat-label {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--white-45);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Responsive per Fonti */
@media (max-width: 768px) {
  .sources-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .sources-list {
    padding: 16px 20px;
    max-height: 400px;
  }
  
  .sources-header {
    padding: 16px 20px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-item {
    padding: 20px 16px;
  }
}
