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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

header h1 {
  font-size: 1.8rem;
  color: #2c3e50;
}

/* Calendar styles */
.calendar {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 20px;
  margin-bottom: 30px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-header h2 {
  font-size: 1.3rem;
  color: #2c3e50;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #f0f0f0;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  font-size: 1.2rem;
  transition: background 0.2s;
}

.nav-btn:hover {
  background: #e0e0e0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.weekday {
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: #666;
  padding: 8px 4px;
}

.day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  min-height: 50px;
}

.day.empty {
  cursor: default;
}

.day-number {
  font-weight: 500;
}

.guest-name {
  font-size: 0.65rem;
  color: white;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90%;
}

.day.available {
  background: #e8f5e9;
  color: #2e7d32;
}

.day.available:hover {
  background: #c8e6c9;
}

.day.reserved {
  background: #ffcdd2;
  color: #c62828;
}

.day.reserved .guest-name {
  color: #c62828;
}

.day.past {
  background: #f5f5f5;
  color: #9e9e9e;
  cursor: not-allowed;
}

.day.unavailable {
  background: #f5f5f5;
  color: #9e9e9e;
  cursor: not-allowed;
}

.day.selected {
  background: #1976d2 !important;
  color: white !important;
}

.day.in-range {
  background: #bbdefb !important;
  color: #1565c0 !important;
}

/* Legend */
.legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #666;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.available {
  background: #e8f5e9;
  border: 2px solid #2e7d32;
}

.dot.reserved {
  background: #ffcdd2;
  border: 2px solid #c62828;
}

.dot.past {
  background: #f5f5f5;
  border: 2px solid #9e9e9e;
}

/* Form styles */
.reservation-form {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 25px;
}

.reservation-form h3 {
  margin-bottom: 20px;
  color: #2c3e50;
}

.error-message {
  background: #ffebee;
  color: #c62828;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.date-selection {
  margin-bottom: 20px;
}

.date-hint {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.selected-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.date-field label,
.form-field label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: #555;
}

.date-field input,
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.date-field input:focus,
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #1976d2;
}

.date-field input[readonly] {
  background: #fafafa;
  cursor: pointer;
}

.form-field {
  margin-bottom: 18px;
}

.form-hint {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-top: 4px;
}

.form-field textarea {
  resize: vertical;
  min-height: 80px;
}

button[type="submit"] {
  width: 100%;
  padding: 14px;
  background: #1976d2;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

button[type="submit"]:hover:not(:disabled) {
  background: #1565c0;
}

button[type="submit"]:disabled {
  background: #bdbdbd;
  cursor: not-allowed;
}

/* Confirmation page */
.confirmation {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 40px;
  text-align: center;
}

.success-icon {
  width: 60px;
  height: 60px;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px;
}

.confirmation h2 {
  color: #2e7d32;
  margin-bottom: 10px;
}

.confirmation > p {
  color: #666;
  margin-bottom: 30px;
}

.reservation-details {
  text-align: left;
  background: #fafafa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
}

.detail {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.detail:last-child {
  border-bottom: none;
}

.detail .label {
  font-weight: 500;
  color: #666;
}

.detail .value {
  color: #333;
}

.btn {
  display: inline-block;
  padding: 12px 30px;
  background: #1976d2;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.2s;
}

.btn:hover {
  background: #1565c0;
}

/* Blocked dates */
.day.blocked {
  background: #fff3e0;
  color: #e65100;
}

.blocked-label {
  font-size: 0.6rem;
  color: #e65100;
}

.dot.blocked {
  background: #fff3e0;
  border: 2px solid #e65100;
}

/* Admin Login */
.admin-login {
  max-width: 400px;
  margin: 60px auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 40px;
}

.admin-login h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
}

.login-form .form-field {
  margin-bottom: 20px;
}

.login-form button {
  width: 100%;
}

.back-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  color: #666;
  text-decoration: none;
}

.back-link:hover {
  color: #1976d2;
}

/* Admin Page */
.admin-page {
  max-width: 900px;
  margin: 0 auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.admin-header h2 {
  color: #2c3e50;
}

.admin-actions {
  display: flex;
  gap: 10px;
}

.admin-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 25px;
  margin-bottom: 25px;
}

.admin-section h3 {
  color: #2c3e50;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.admin-section h4 {
  color: #666;
  font-size: 0.9rem;
  margin: 20px 0 10px;
}

.empty-state {
  color: #999;
  text-align: center;
  padding: 20px;
}

.success-message {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
}

/* Reservation list */
.reservation-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reservation-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #fafafa;
  border-radius: 8px;
  gap: 15px;
}

.reservation-info {
  flex: 1;
}

.reservation-guest {
  font-weight: 600;
  color: #2c3e50;
}

.reservation-dates {
  color: #1976d2;
  font-size: 0.9rem;
  margin: 4px 0;
}

.reservation-details {
  font-size: 0.85rem;
  color: #666;
}

.reservation-notes {
  font-style: italic;
}

.reservation-actions {
  display: flex;
  gap: 8px;
}

/* Blocked dates list */
.blocked-list {
  margin-top: 20px;
}

.blocked-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #fff3e0;
  border-radius: 6px;
  margin-bottom: 8px;
}

.blocked-dates {
  color: #e65100;
}

.blocked-reason {
  color: #666;
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: #1976d2;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background: #1565c0;
}

.btn-secondary {
  background: #f5f5f5;
  color: #333;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-danger {
  background: #f44336;
}

.btn-danger:hover {
  background: #d32f2f;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Form rows */
.form-row {
  display: flex;
  gap: 15px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-row .form-field {
  flex: 1;
  min-width: 150px;
  margin-bottom: 0;
}

.form-row .btn {
  height: 42px;
}

/* Block dates form */
.block-dates-form {
  background: #fafafa;
  padding: 20px;
  border-radius: 8px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 30px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h3 {
  margin-bottom: 20px;
  color: #2c3e50;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 15px;
  }

  .calendar-grid {
    gap: 2px;
  }

  .day {
    min-height: 40px;
    font-size: 0.8rem;
  }

  .guest-name,
  .blocked-label {
    display: none;
  }

  .selected-dates {
    grid-template-columns: 1fr;
  }

  .legend {
    flex-wrap: wrap;
    gap: 10px;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .reservation-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .reservation-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 10px;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row .form-field {
    width: 100%;
  }
}
