* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #f5f7fa;
  color: #1e293b;
  padding: 16px;
  min-height: 100vh;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* Auth */
.auth-card {
  max-width: 400px;
  margin: 2rem auto;
  background: white;
  padding: 2rem;
  border-radius: 24px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.auth-card h1 {
  font-size: 2rem;
  margin-bottom: 0.2rem;
}

.sub {
  color: #64748b;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font-size: 1rem;
  background: white;
  transition: border 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 40px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn.primary {
  background: #0d6efd;
  color: white;
}

.btn.primary:hover {
  background: #0b5ed7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn.secondary {
  background: #e2e8f0;
  color: #1e293b;
}

.link-btn {
  background: none;
  border: none;
  color: #0d6efd;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.message {
  margin-top: 0.8rem;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.message.error {
  background: #fee2e2;
  color: #b91c1c;
}

.message.success {
  background: #dcfce7;
  color: #166534;
}

/* App Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.app-header h2 {
  font-size: 1.5rem;
}

.logout-btn {
  background: #ef4444;
  border: none;
  padding: 8px 20px;
  border-radius: 30px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

/* Calendar */
.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  background: white;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.icon-btn {
  background: #f1f5f9;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 40px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: #e2e8f0;
}

#current-date-display {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Sport chips */
.sport-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.sport-chip {
  background: white;
  padding: 10px 20px;
  border-radius: 40px;
  border: 1px solid #d1d5db;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.sport-chip:hover {
  border-color: #0d6efd;
  background: #f8faff;
}

.sport-chip.active {
  background: #0d6efd;
  color: white;
  border-color: #0d6efd;
}

/* Slots grid */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 0.5rem;
}

.slot-item {
  background: white;
  border-radius: 12px;
  padding: 10px 4px;
  text-align: center;
  font-size: 0.75rem;
  border: 2px solid #e2e8f0;
  transition: all 0.2s;
}

.slot-item .status-badge {
  display: block;
  font-size: 0.6rem;
  margin-top: 3px;
}

.slot-item.available {
  border-color: #22c55e;
  background: #f0fdf4;
}

.slot-item.partial {
  border-color: #eab308;
  background: #fefce8;
}

.slot-item.full {
  border-color: #ef4444;
  background: #fee2e2;
  opacity: 0.6;
  cursor: not-allowed;
}

.slot-item.past {
  opacity: 0.4;
  cursor: not-allowed;
}

.slot-item.closed {
  background: #e2e8f0;
  color: #64748b;
  cursor: not-allowed;
}

.slot-item:not(.full):not(.past):not(.closed) {
  cursor: pointer;
}

.slot-item:not(.full):not(.past):not(.closed):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  padding: 16px;
}

.modal-content {
  background: white;
  max-width: 450px;
  width: 100%;
  padding: 2rem;
  border-radius: 28px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.close-btn {
  position: absolute;
  right: 20px;
  top: 10px;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  color: #64748b;
}

.close-btn:hover {
  color: #1e293b;
}

#booking-summary {
  background: #f1f5f9;
  padding: 1rem;
  border-radius: 16px;
  margin: 1rem 0;
}

#booking-summary p {
  margin: 0.3rem 0;
}

/* My bookings */
#my-bookings {
  background: white;
  border-radius: 20px;
  padding: 1.5rem;
  margin-top: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

#my-bookings h4 {
  margin-bottom: 1rem;
}

.booking-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
}

.booking-item:last-child {
  border-bottom: none;
}

.status-badge-pill {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 40px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #e2e8f0;
  text-transform: uppercase;
}

/* Responsive */
@media (min-width: 640px) {
  .slots-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  
  body {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .modal-content {
    padding: 1.5rem;
  }
}