@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Inter:wght@400;500;600&display=swap');

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

:root {
  --green: #0d5c2e;
  --green-dark: #083d1e;
  --green-felt: #1a7a3a;
  --gold: #d4af37;
  --gold-light: #f0d060;
  --gold-dark: #b8960c;
  --red: #c0392b;
  --black: #1a1a1a;
  --white: #f5f0e1;
  --card-bg: rgba(0, 0, 0, 0.35);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--green-dark);
  color: var(--white);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 50% 0%, var(--green-felt) 0%, var(--green-dark) 70%),
    repeating-conic-gradient(rgba(255,255,255,0.02) 0% 25%, transparent 0% 50%);
  background-size: 100% 100%, 20px 20px;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
}

/* ===== LOGIN PAGE ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.casino-border {
  padding: 3px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark), var(--gold), var(--gold-light), var(--gold));
  border-radius: 20px;
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.3), 0 20px 60px rgba(0,0,0,0.5);
}

.login-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 2.5rem 2rem;
  text-align: center;
}

.card-suits {
  font-size: 1.5rem;
  letter-spacing: 1rem;
  color: var(--gold);
  margin: 0.5rem 0;
}

.login-card h1 {
  font-size: 2.2rem;
  color: var(--gold);
  margin: 0.8rem 0 0.3rem;
  text-shadow: 0 2px 10px rgba(212, 175, 55, 0.4);
}

.event-banner {
  margin: 0.8rem 0;
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 10px;
}

.event-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.event-date {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.event-disclaimer {
  font-size: 0.7rem;
  color: rgba(245, 240, 225, 0.35);
  font-style: italic;
  margin-top: 0.2rem;
}

.subtitle {
  color: rgba(245, 240, 225, 0.7);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input[type="text"], input[type="number"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--white);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.3s;
  outline: none;
}

input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

input::placeholder {
  color: rgba(245, 240, 225, 0.4);
}

.btn-gold {
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--black);
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Playfair Display', serif;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(212, 175, 55, 0.4);
}

.btn-gold:active {
  transform: translateY(0);
}

.error {
  color: var(--red);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* ===== APP PAGE ===== */
.app-page {
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.app-header {
  text-align: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  margin-bottom: 1.5rem;
}

.app-header h1 {
  font-size: 1.8rem;
  color: var(--gold);
  text-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

.app-header .welcome {
  color: rgba(245, 240, 225, 0.7);
  margin-top: 0.3rem;
}

.app-header .welcome strong {
  color: var(--gold-light);
}

.logout-btn {
  background: none;
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold);
  padding: 0.4rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-top: 0.8rem;
  transition: all 0.3s;
}

.logout-btn:hover {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
}

/* Section titles */
.section-title {
  font-size: 1.3rem;
  color: var(--gold);
  margin: 1.5rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(212,175,55,0.3), transparent);
}

/* Drinks grid */
.drinks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.drink-card {
  background: var(--card-bg);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 14px;
  padding: 1.2rem;
  transition: all 0.3s;
}

.drink-card:hover {
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.drink-card.fully-reserved {
  opacity: 0.5;
  pointer-events: none;
}

.drink-card .drink-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.drink-card .drink-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
}

.drink-card .drink-type {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-weight: 500;
  white-space: nowrap;
}

.type-alcool-fort { background: rgba(192, 57, 43, 0.3); color: #e74c3c; }
.type-alcool-moyen { background: rgba(230, 126, 34, 0.3); color: #e67e22; }
.type-vin { background: rgba(142, 68, 173, 0.3); color: #bb6bd9; }
.type-vin-petillant { background: rgba(142, 68, 173, 0.3); color: #bb6bd9; }
.type-soft { background: rgba(46, 204, 113, 0.3); color: #2ecc71; }
.type-energy-drink { background: rgba(52, 152, 219, 0.3); color: #3498db; }
.type-cocktail { background: rgba(255, 107, 129, 0.3); color: #ff6b81; }
.type-biere { background: rgba(241, 196, 15, 0.3); color: #f1c40f; }

/* Progress bar */
.progress-container {
  margin: 0.6rem 0;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.progress-fill-comite {
  position: absolute;
  height: 100%;
  background: linear-gradient(90deg, #6c5ce7, #a29bfe);
  border-radius: 5px 0 0 5px;
  transition: width 0.5s ease;
  left: 0;
}

.progress-fill-invites {
  position: absolute;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  transition: width 0.5s ease;
}

.progress-text {
  display: flex;
  justify-content: flex-start;
  gap: 0.8rem;
  font-size: 0.75rem;
  color: rgba(245, 240, 225, 0.6);
  margin-top: 0.3rem;
  flex-wrap: wrap;
}

.progress-text span:last-child {
  margin-left: auto;
}

.legend-comite {
  color: #a29bfe;
}

.legend-invites {
  color: var(--gold-light);
}

.comite-badge {
  text-align: center;
  color: #a29bfe;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Reserve form inside card */
.reserve-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
  align-items: center;
}

.reserve-form input[type="number"] {
  width: 60px;
  padding: 0.5rem 0.2rem;
  text-align: center;
  font-size: 1rem;
  -moz-appearance: textfield;
}

.reserve-form input[type="number"]::-webkit-outer-spin-button,
.reserve-form input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn-qty {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold);
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-qty:hover {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--gold);
}

.btn-qty:active {
  transform: scale(0.9);
}

.btn-reserve {
  flex: 1;
  padding: 0.5rem;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--black);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-reserve:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

.btn-reserve:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* My reservations */
.my-reservations {
  margin-top: 1rem;
}

.reservation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid rgba(212, 175, 55, 0.1);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
}

.reservation-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.reservation-info .name {
  font-weight: 600;
  color: var(--white);
}

.reservation-info .detail {
  font-size: 0.8rem;
  color: rgba(245, 240, 225, 0.5);
}

.btn-cancel {
  padding: 0.4rem 0.8rem;
  background: rgba(192, 57, 43, 0.2);
  color: var(--red);
  border: 1px solid rgba(192, 57, 43, 0.3);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s;
}

.btn-cancel:hover {
  background: rgba(192, 57, 43, 0.4);
}

.empty-state {
  text-align: center;
  color: rgba(245, 240, 225, 0.4);
  padding: 2rem;
  font-style: italic;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--gold);
  color: var(--black);
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: 0 5px 30px rgba(0,0,0,0.4);
  transition: transform 0.4s ease;
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: var(--red);
  color: white;
}

/* Lock notice */
.lock-notice {
  text-align: center;
  color: var(--red);
  background: rgba(192, 57, 43, 0.15);
  border: 1px solid rgba(192, 57, 43, 0.3);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.locked-badge {
  font-size: 0.8rem;
  color: rgba(245, 240, 225, 0.4);
}

/* Admin panel */
#admin-panel {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
}

.admin-controls {
  margin-bottom: 1.5rem;
  text-align: center;
}

.btn-unlock {
  background: linear-gradient(135deg, #2ecc71, #27ae60) !important;
  color: white !important;
}

.btn-unlock:hover {
  background: linear-gradient(135deg, #27ae60, #2ecc71) !important;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
}

.admin-table thead {
  background: rgba(212, 175, 55, 0.15);
}

.admin-table th {
  text-align: left;
  padding: 0.8rem 1rem;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
}

.admin-table td {
  padding: 0.5rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}

.drink-group-header td {
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold-light);
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
}

/* Guest management */
.guest-add-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.guest-add-form input {
  flex: 1;
}

/* Responsive */
@media (max-width: 600px) {
  .login-card {
    padding: 1.8rem 1.2rem;
  }
  .login-card h1 {
    font-size: 1.7rem;
  }
  .app-page {
    padding: 0.8rem;
  }
  .drinks-grid {
    grid-template-columns: 1fr;
  }
  .app-header h1 {
    font-size: 1.4rem;
  }
}
