/* ====== CSS BASE MOBILE-FIRST - beercounter.it (cartoon/simpatico) ====== */

:root {
  --color-primary: #ffca3a;
  /* giallo birra cartoon */
  --color-secondary: #1982c4;
  /* blu acceso per header */
  --color-background: #fff3e6;
  /* sfondo chiaro caldo */
  --color-text: #1a1a1a;
  /* testo leggibile */
  --color-accent: #d81159;
  /* rosso rosa acceso */
  --color-note: #5a5a5a;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: 'Helvetica Neue', sans-serif;
  background-color: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* ===== HEADER ===== */
.site-header {
  display: flex;
  align-items: center;
  padding: 16px;
  background-color: var(--color-secondary);
  border-bottom: 4px solid var(--color-primary);
  width: 100%;
}

/* Stili per la header della pagina group.html */
#back-btn {
  font-size: 0.8rem;      /* Font più piccolo */
  padding: 4px 8px;       /* Ridotto padding */
  margin-right: 8px;      /* Margine ridotto */
  cursor: pointer;
  flex: 0 0 20%;         /* Occupare al massimo il 20% della larghezza */
}

#group-name-header {
  flex: 1 1 80%;         /* Occupare il restante 80% */
  text-align: left;
  font-size: 1.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo {
  width: 50px;
  height: auto;
}

/* ===== FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 30px 0;
  font-size: 0.8rem;
  color: #999;
  background-color: transparent;
}

/* ===== HOME ===== */
.home {
  text-align: center;
  padding: 60px 16px 0;
}

.home h1 {
  font-size: 2.4rem;
  margin-bottom: 12px;
  color: var(--color-secondary);
}

.home p {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--color-accent);
}

.note {
  margin-top: 20px;
  font-size: 0.95rem;
  color: var(--color-note);
}

/* ===== BOTTONI ===== */
.btn-primary {
  background-color: var(--color-primary);
  color: #1a1a1a;
  border: none;
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  background-color: var(--color-accent);
  color: white;
}

.btn-secondary {
  background-color: var(--color-accent);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 0.95rem;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 40px;
  transition: background-color 0.3s ease;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
  background-color: #a80b41;
}

.btn-small {
  background-color: var(--color-primary);
  border: none;
  color: var(--color-text);
  padding: 6px 12px;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-small:hover {
  background-color: var(--color-accent);
  color: white;
}

/* ===== DASHBOARD ===== */
.dashboard {
  padding: 40px 16px;
  text-align: center;
}

.dashboard h1 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--color-secondary);
}

.groups-section {
  margin-top: 40px;
}

.groups-section h2 {
  font-size: 1.4rem;
  margin-bottom: 16px;
  color: var(--color-accent);
}

#groups-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#groups-list li {
  background-color: white;
  border: 2px solid var(--color-primary);
  border-left: 8px solid var(--color-secondary);
  padding: 16px;
  border-radius: 10px;
  text-align: left;
  box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

#groups-list li:hover {
  transform: translateY(-2px);
}

#groups-list li::before {
  content: "🍺 ";
  margin-right: 4px;
}

/* ===== CARD GRUPPI - STATO UTENTE ===== */
.card-gruppo {
  background-color: white;
  border: 2px solid var(--color-primary);
  border-left: 10px solid var(--color-accent);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.1);
  text-align: left;
  transition: transform 0.2s;
  position: relative;
}

.card-gruppo:hover {
  transform: translateY(-2px);
}

.card-gruppo h3 {
  font-size: 1.2rem;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.card-gruppo p {
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: var(--color-text);
}

.card-gruppo .btn-primary[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Emoji badge ruolo */
.card-gruppo p::before {
  content: "\1F464  "; /* 👤 */
  margin-right: 4px;
  color: var(--color-secondary);
}

.card-gruppo[data-ruolo="admin"] p::before {
  content: "\1F6E0\FE0F  "; /* 🛠️ */
  color: var(--color-accent);
}

.card-gruppo[data-ruolo="attesa"] p::before {
  content: "\23F3  "; /* ⏳ */
  color: gray;
}

.card-gruppo[data-ruolo="attesa"] {
  border-color: gray;
  border-left-color: gray;
  opacity: 0.9;
}

/* === FORM CREAZIONE GRUPPO === */
.group-form {
  margin-top: 20px;
  background-color: white;
  border: 2px dashed var(--color-primary);
  border-radius: 12px;
  padding: 20px;
  max-width: 500px;
  margin-inline: auto;
  box-shadow: 1px 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.group-form h3 {
  margin-bottom: 16px;
  color: var(--color-secondary);
  font-size: 1.2rem;
}

.group-form input[type="text"] {
  width: 80%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 16px;
}

.group-form input[type="text"]:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 4px var(--color-accent);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  .home h1 {
    font-size: 2.8rem;
  }
  
  .btn-primary {
    font-size: 1.1rem;
    padding: 16px 32px;
  }
  
  .dashboard h1 {
    font-size: 2.4rem;
  }
  
  .groups-section h2 {
    font-size: 1.6rem;
  }
  
  .btn-secondary {
    font-size: 1.05rem;
    padding: 14px 28px;
  }
}

@media (min-width: 1024px) {
  body {
    max-width: 900px;
    margin: auto;
  }
}

#dev-panel {
  padding: 20px;
  text-align: center;
  background-color: #eee;
  border-top: 2px dashed var(--color-accent);
}

/* ====== GROUP PAGE STYLES (Integrati in style.css) ====== */
/* Regole specifiche per la pagina group.html (area del gruppo) */
#transaction-section,
#history-section {
  margin: 20px auto;
  padding: 15px;
  border: 1px solid var(--color-primary);
  background-color: var(--color-background);
  max-width: 600px;
}

#transaction-section label,
#transaction-section select,
#transaction-section div,
#transaction-section button,
#history-section h2,
#history-list p {
  display: block;
  margin-top: 10px;
}

#transaction-type label {
  display: block;  /* Forza a capo per ogni radio button */
}

#recipients-list > div {
  margin-bottom: 8px;
  /* Allinea checkbox e testo in linea */
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Classe di utilità per pulsanti verticali */
.btn-vertical {
  display: block;
  width: 100%;
  margin-top: 10px;
  text-align: center;
}

/* ===== Stili per Privacy & Cookie Policy ===== */
.policy-page {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 16px;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.policy-page header {
  text-align: center;
  margin-bottom: 24px;
}

.policy-page header h1 {
  font-size: 2rem;
  color: var(--color-secondary);
}

.policy-page h2 {
  font-size: 1.5rem;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--color-accent);
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 4px;
}

.policy-page p,
.policy-page li {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 16px;
}

.policy-page ul {
  margin-left: 20px;
}

.policy-page a {
  color: var(--color-secondary);
  text-decoration: underline;
}

.policy-page button.back-btn {
  display: inline-block;
  margin-bottom: 24px;
  background-color: var(--color-secondary);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.policy-page button.back-btn:hover {
  background-color: var(--color-accent);
}