/* =========================================================
   VARIABILI GLOBALI
========================================================= */
:root {
  --primary: #0d6efd;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --gray: #6c757d;
  --bg: #f5f7ff;
  --card-bg: #ffffff;
}

/* =========================================================
   RESET & BASE
========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Inter", sans-serif;
  background: linear-gradient(135deg, #eef2ff, #f8f9ff);
}

/* =========================================================
   LAYOUT
========================================================= */
.page-wrapper,
.page-container,
.form-wrapper,
.player-wrapper,
.user-wrapper,
.edit-wrapper,
.dashboard-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.page-wrapper { max-width: 1400px; }

@media (max-width: 768px) {
  .page-wrapper,
  .page-container,
  .form-wrapper,
  .player-wrapper,
  .user-wrapper,
  .edit-wrapper,
  .dashboard-container {
    padding: 16px;
  }
}

.columns {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .columns { flex-direction: row; }
}

/* =========================================================
   TITOLI & TESTI
========================================================= */
.page-title,
.player-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 18px;
  text-align: center;
}

.page-sub,
.info-box {
  color: #666;
  font-size: 1rem;
  margin-bottom: 20px;
}

.category-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
}

/* =========================================================
   BREADCRUMB
========================================================= */
.breadcrumb {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.breadcrumb li { color: #777; }

.breadcrumb li a {
  text-decoration: none;
  font-weight: 600;
  color: var(--primary);
}

.breadcrumb li::after {
  content: "›";
  margin: 0 4px;
  color: #999;
}

.breadcrumb li:last-child {
  font-weight: 700;
  color: #333;
}

.breadcrumb li:last-child::after { content: ""; }

/* =========================================================
   BUTTONS
========================================================= */
.btn-main,
.btn-edit,
.btn-save,
.btn-select,
.btn-view,
.btn-confirm,
.btn-delete,
.btn-back,
.btn-yellow,
.btn-gray,
.login-btn {
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: 0.2s;
}

.btn-main,
.btn-edit,
.btn-save,
.btn-select,
.btn-view,
.login-btn { background: var(--primary); color: #fff; }

.btn-confirm { background: var(--success); color: #fff; }
.btn-delete  { background: var(--danger);  color: #fff; }
.btn-yellow  { background: var(--warning); color: #4c3b00; }
.btn-gray    { background: var(--gray);    color: #fff; }

.btn-back {
  background: #fff;
  border: 2px solid #ccc;
  color: #333;
}

.btn-small {
  padding: 8px 12px;
  border-radius: 12px;
  background: #e8f6ff;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

/* =========================================================
   CARDS
========================================================= */
.card,
.stat-card,
.players-card,
.team-card,
.formation-card,
.form-card,
.custom-card,
.user-card,
.dashboard-card,
.login-card {
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 18px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.1);
  transition: 0.2s;
}

.team-card:hover,
.formation-card:hover,
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.12);
}

/* =========================================================
   GRID STATISTICHE
========================================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

/* =========================================================
   TABELLE
========================================================= */
.table-wrapper {
  overflow-x: auto;
  margin-top: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th {
  background: #f0f4ff;
  padding: 12px;
  font-weight: 700;
  text-align: left;
}

td {
  padding: 10px;
  border-bottom: 1px solid #e5e5e5;
  background: #fafbff;
}

tr:hover td { background: #f7faff; }

/* =========================================================
   LISTE
========================================================= */
.player-list,
.team-list,
.selected-list,
.formation-list {
  list-style: none;
}

.player-item,
.selected-item {
  background: #f7f9ff;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid #e3e8f0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-item:hover { background: #eef3ff; }

.selected-item {
  background: #e8f0ff;
  border-color: #cdd9f4;
}

/* =========================================================
   BADGE & STATI
========================================================= */
.badge,
.badge-player,
.counter-badge,
.squadra-badge {
  background: var(--primary);
  color: #fff;
  padding: 6px 14px;
  border-radius: 18px;
  font-weight: 700;
  font-size: 0.8rem;
}

.stato-verde { color: var(--success); font-weight: 700; }
.stato-rosso { color: var(--danger);  font-weight: 700; }

/* =========================================================
   FORM
========================================================= */
.form-group { margin-bottom: 16px; }

.form-group label {
  font-weight: 700;
  margin-bottom: 6px;
  display: block;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #d0d7e2;
  background: #f9faff;
  font-size: 1rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.form-check input {
  width: 22px;
  height: 22px;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 22px 0 10px;
}

/* =========================================================
   UTILITIES
========================================================= */
.empty-msg {
  background: #eef4ff;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
  color: #555;
}

.logo,
.dashboard-logo {
  width: 170px;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.25));
  margin-bottom: 18px;
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* =========================================================
   DASHBOARD
========================================================= */
.dashboard-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dashboard-btn {
  width: 100%;
  padding: 18px;
  background: #fff;
  border-radius: 16px;
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  color: #000;
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  transition: 0.2s;
}

.dashboard-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
}

.logout-btn {
  margin-top: 30px;
  padding: 14px 22px;
  background: #000;
  color: white;
  border-radius: 14px;
  text-decoration: none;
}
